Sign in
Log inSign up
Objects
Objects
#objects
10 followers·315 articles
Popular this week 🔥
Prateek Gogia
Discuss

·

80 likes

·

596 reads

rufai oluwadamilola
This is so insightful and informative ❤️
3
Discuss

·

76 likes

·

614 reads

Jarrod Connolly
A great introduction to shallow vs deep cloning in JavaScript. Be careful using JSON parse/stringify to deep clone as it does not support some JavaScript features when used to clone objects. Date objects will convert to strings. Functions, symbols, and undefined are also not correctly converted over. Just a couple of things to watch out for if one is looking for a proper deep clone. Better off to use something like lodash cloneDeep for correctness and performance reasons.
6