💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## **遍历删除对象属性** ``` var obj={ age:18, name:'yc', sex:'男', sayHi:function () { console.log('Hi'); } }; // for in可以遍历对象的成员 for (var key in obj){ console.log(key+'---'+obj[key]); } var o={}; for (var i=0 ;i<10;i++){ o['a'+i]=i*2; } for (var key in o){ console.log(key+'---'+o[key]); } //删除属性 delete o.name; delete o.sayHi(); ```