Javascript Clone Object | Writing own deep clone function | JavaScript Interview Question

Published: 01 January 1970
on channel: Ankit Saxena
282
10

In this video, we are going to learn how to deep clone a javascript object correctly. We'll see multiple solutions to do so - spread operator, Object.assign(), writing own deep clone function, using library like lodash, and JSON.stringify.

Timestamps:
00:00 Introduction
01:34 Using spread operator
01:58 Using Object.assign()
02:18 Problem with spread operator and Object.assign()
03:46 Using JSON.parse and JSON.stringify
04:12 Using lodash _.cloneDeep()
04:59 Writing own deep clone function
09:30 Code Explanation with dry run

GitHub Repo (source code) - https://github.com/ankitsaxena21/JS-D...

LinkedIn Profile -   / iankit  


On this page of the site you can watch the video online Javascript Clone Object | Writing own deep clone function | JavaScript Interview Question with a duration of hours minute second in good quality, which was uploaded by the user Ankit Saxena 01 January 1970, share the link with friends and acquaintances, this video has already been watched 282 times on youtube and it was liked by 10 viewers. Enjoy your viewing!