Create a Deep Copy using Recursion | Deep Cloning in JS

preview_player
Показать описание
In this video, we will be creating a recursive function to create a deep copy of an object with nested objects/arrays in JavaScript. This function also acts as a great example of how you can solve a problem using recursion.
(also has updated code which handles Date type values)
Рекомендации по теме
Комментарии
Автор

Is this function working with {d: new Date()} object?

SANJIBNATH
Автор

How will you copy functions(regular) and class as well?

anandbaraik
Автор

For the output iam getting a json object .like the keynames are converted into strings.could you clear this?

e-likitha
Автор

very clear explanation and apt test case.
question - is it better than json parse (json stringfy) in terms of performance ?

koundinyabhogaraju
Автор

Thank you. That worked. And I understood how this works.

blueblue
Автор

does this deep copy functions inside object?

pratik_N
welcome to shbcf.ru