📜  如何从打字稿代码示例中的对象中删除元素

📅  最后修改于: 2022-03-11 14:48:31.243000             🧑  作者: Mango

代码示例2
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"}