Javascript Object Delete Properties And Objects

Description

Javascript Object Delete Properties And Objects



let myObject = {name:'jimmy', age:12, height:123}
delete myObject["jimmy"];
delete myObject.age;/*from www .j  a v a 2 s .  c  om*/

with (myObject) {
    delete height;
}

// and an object
let myObject = new Object();
delete myObject;

let myObj2 = {};
myObj2 = null;



PreviousNext

Related