Shallow vs Deep Copy in JavaScript | JS Basics

preview_player
Показать описание
Continuing from where we left in the previous video we will learn about the shortcomings of using the spread operator which creates a Shallow copy. We will also see the solution to the problem by creating what is called a deep copy in JS.

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

Yes JSON stringify and parse solve the issue but when we have a method in the object it will drop the method from the object straight away, so to solve that we have to use the library Lodash, This solves the issue

nirajs.golhar