【发布时间】:2018-02-03 11:56:01
【问题描述】:
以 Lodash omit 为例,用这段代码删除对象的属性:
this.current.obj = omit(this.current.obj, ['sellerSupportWeb', 'sellerSupportAgency', 'sellerSupportAgent'])
但这会创建另一个对象this.current.obj,但在我的情况下,我需要保留相同的对象
您有其他解决方案吗?但不是delete 运算符
【问题讨论】:
-
“需要保留同一个对象”是什么意思?您需要对象 - 旧对象(带有属性)和新对象(没有属性)?
标签: javascript object ecmascript-6 lodash