Object.assign不是deep clone
Using Object.assign
Update:
This method has a flaw that it only does a shallow copy. It
means that nested properties are still going to be copied by
reference.Be careful about it.
这也是我亲自踩坑之后才搜索到的。
Using Object.assign
Update:
This method has a flaw that it only does a shallow copy. It
means that nested properties are still going to be copied by
reference.Be careful about it.
这也是我亲自踩坑之后才搜索到的。