-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6、深浅拷贝 #6
Comments
深浅拷贝出现的缘由:
浅拷贝只复制指向某个对象的指针,而不复制对象本身,新旧对象还是会共享同一块内存。但深拷贝会另外创造一个一模一样的对象,新对象跟原对象不共享内存,修改新对象不会改到原对象。 当 引用类型 存在多层数据的时候,浅拷贝克隆的不够彻底,只能克隆一层 |
JSON.parse(JSON.stringify(object))局限性
|
浅拷贝的实现
|
深拷贝
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: