【发布时间】:2020-12-04 18:38:32
【问题描述】:
在我的应用程序中,我有一个包含 Immutable.js 对象和 vanilla JS 对象的对象。我想深度复制那个对象。使用 Lodash 的 cloneDeep 函数,我收到一条警告,上面写着:iterable.length has been deprecated, use iterable.size or iterable.count().。
有没有办法克隆整个对象?
我要深度克隆的对象是这样的:
obj: {
immutableJSObj: EditorState, // this is the one that can't be copied with Lodash
vanillaJSObj: {
a: { c: ... },
b: { d: ... }
}
}
【问题讨论】:
标签: javascript lodash immutable.js draftjs