Answers for "how to remove elements from object in typescript"

11

how to remove a property from an object in javascript

var person = {
        name: "Harry",
        age: 16,
        gender: "Male"
    };
    
    // Deleting a property completely
    delete person.age;
    alert(person.age); // Outputs: undefined
    console.log(person); // Prints: {name: "Harry", gender: "Male"}
Posted by: Guest on April-25-2020
0

how to remove elements from object in typescript

var person = {
        name: "Harry",
        age: 16,
        gender: "Male"
    };
    
    // Deleting a property completely
    delete person.age;
    alert(person.age); // Outputs: undefined
    console.log(person); // Prints: {name: "Harry", gender: "Male"}
Posted by: Guest on April-08-2021

Code answers related to "how to remove elements from object in typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language