JS 清空对象值及删除单个对象属性
2018-12-10 本文已影响0人
Pugss_28c5
/* 清除对象属性*/
var a = {a:1,b:2}
Object.keys(a).forEach(key =>a[key]='');
console.log(a)
/* 删除某个对象*/
console.log(deletea.a)
console.log(a)
/* 清除对象属性*/
var a = {a:1,b:2}
Object.keys(a).forEach(key =>a[key]='');
console.log(a)
/* 删除某个对象*/
console.log(deletea.a)
console.log(a)