delete操作符
delete操作符用于删除对象的某个属性;没有指向这个属性的引用,则会被释放。
const obj = { name: 'yibo', age: 25 } console.log("one---" + obj.name) // one---yibo delete obj.name console.log("two---" +obj.name) // two---undefined
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/244368.html