Shallow vs Deep Cloning in 60 seconds

preview_player
Показать описание
In this short video I talk about the difference between shallow copying and deep copying objects and arrays in JavaScript.

#Shorts

---

👀 Follow Me:
Рекомендации по теме
Комментарии
Автор

just learnt you can use to do deep copy

anandpbgupta
Автор

Thanks, your explanation is really nice to follow :)

Just a tiny little thing I noticed about your copyDeep() function (see 0:33): You just "return;" instead of "return inputObject;"

ateamhannibal
Автор

Amazing! I understand this so much better now! Thank you so much.

demetriuslewis
Автор

what about `const obj1 = Object.assign({}, obj0)` ?

skladniki
Автор

does this work for deeply nested values as well?

awekeningbro
Автор

Or a normal copy with
let copy = {...original}

randomdamian