/* 清除对象属性*/
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)
本文标题:JS 清空对象值及删除单个对象属性
本文链接:https://www.haomeiwen.com/subject/bckfcqtx.html
网友评论