Shallow copy vs Deep copy in JavaScript #javascriptinterviewquestions

preview_player
Показать описание

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

Completed...along with practice and notes preparation.tq 🙏🙏anna.... for this valuable playlist

rajithapuramani
Автор

My revision is completed sir . I prepared notes also

rekhaharikaharshita
Автор

==> copy -- Don't do normal copy with non-primitives (obj, func, arrays, class)
-- As they follow call by reference
==> shallow copy -- Do shallow copy for 1 level of copying, for nested level it doesn't works
-- Shallow copy is faster than deep copy
-- spread syntax, object.assign(), object.create(), array.prototype.concat() etc
==> Deep copy -- Do Deep copy for nested level only

-- Doing it for 1 level is waste of time
-- use JSON.parse(JSON.stringify()) --> converting object to string then back to object

-- I don't understand why we are converting it original form to do deep


Remaining understood sir

sailaxmikomirineni
visit shbcf.ru