JS - Object and Property的删除用法

在JS中,Object和Property的删除用法:

 1 var myObject = {name:'jimmy', age:12, height:123}
2 delete myObject["jimmy"];
3 delete myObject.age;
4 with (myObject) { 5 delete height; 6 } 7 8 // and an object 9 var myObject = new Object(); 10 delete myObject; 11 12 var myObj2 = {}; 13 myObj2 = null;

 

posted on 2015-08-11 15:55  tx天翔  阅读(465)  评论(0编辑  收藏  举报