38

JavaScript深拷贝的一些坑

 5 years ago
source link: https://juejin.im/post/5b235b726fb9a00e8a3e4e88
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言 之前去一家公司面试的时候,面试官问了我一个问题,说:"如何才能深拷贝一个对象"。当时我心里有些窃喜,这么简单的问题还用想吗?于是脱口而出:"平时常用的有两种办法,第一种用JSON.parse(JSON.stringify(obj)),第二种可以使用fo

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK