WATCH NEXT: Javascript Interview Questions and Answers - Dominate Your Next Interview - kzbin.info/www/bejne/rZ-8fHtombRpaJIsi=5DfbGEfhXWiiv0a_
@AlexAlex-nh5mc2 жыл бұрын
Good lesson, thx
@MonsterlessonsAcademy2 жыл бұрын
You are welcome!
@lovrozagar37292 жыл бұрын
Super helpful, thanks!
@MonsterlessonsAcademy2 жыл бұрын
You're welcome!
@lindermannla2 жыл бұрын
Another great tutorial! Thnxz!
@MonsterlessonsAcademy2 жыл бұрын
My pleasure!
@azizsobirjonov44622 жыл бұрын
great work but maybe it does not work with Date properties))) you should to add "... || input instanceof Date" to the condition of the first if statements.
@MonsterlessonsAcademy2 жыл бұрын
Yeap, you are totally right.
@leonidesmuguercia42112 жыл бұрын
Great video. But what about structuredClone method?
@MonsterlessonsAcademy2 жыл бұрын
You can certainly use it if you don't need to support older browsers.
@andreikrupnik11112 жыл бұрын
отличное видео спасибою
@miloszivkovic66072 жыл бұрын
You are good man!
@MonsterlessonsAcademy2 жыл бұрын
Thank you
@ylsv2 жыл бұрын
So little views and comments for such a cool channel and useful information. Maybe collaborate with Brad Traversy or Kyle Cook?) Thank you for vids!
@MonsterlessonsAcademy2 жыл бұрын
I would love to collaborate with them but they both didn't answer my emails.
@ylsv2 жыл бұрын
@@MonsterlessonsAcademy That's strange, Brad promoted Kyle. Why wouldn't they support more good content... Try twitter, devs seem to be more active there, but u probably know it already
@MonsterlessonsAcademy2 жыл бұрын
@@ylsv I will try again as it costs me nothing. Thanks!
@paulh69332 жыл бұрын
how about structuredClone()
@MonsterlessonsAcademy2 жыл бұрын
Sure you can use that if you don't need to support older browsers like IE for example
@flogger23672 жыл бұрын
Before this usefull tutorial, I`ve known only variants how to implement deep clone array. How to clone function as property in an object ?
@MonsterlessonsAcademy2 жыл бұрын
For example spread operator can copy functions. But the most correct answer is that you should not have functions inside your object because objects are representation of the data. Also it is easier to support plain objects without prototypes, functions, etc
@kmylodarkstar22532 жыл бұрын
what about circular deps? let newA = { a: 1, b: [1, 2], c: [1, [2, 3]], d: { d1: 1, d2: [1, 2], d3: {} } }; newA.d.d3 = newA.d; let deep = deepClone(newA) stackoverflow!!
@MonsterlessonsAcademy2 жыл бұрын
Hi you are totally right it will break as we don't check circular deps. But I don't think that having such things in a real project is a good idea and is needed (can't imagine such case).