JavaScript中删除对象中属性的方法就是 delete:
let obj = { name: 'zhangsan', age: 18}delete obj.name //就删除了name属性了
let obj = {
name: 'zhangsan',
age: 18
}
delete obj.name //就删除了name属性了
若有收获,就点个赞吧
0 人点赞
让时间为你证明