JavaScript Interview - Q What is the difference between deep copy and shallow copy in JavaScript ?

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024
  • 1. FULL JAVASCRIPT INTERVIEW COURSE(with PDF Book)
    JavaScript Interview Masterclass: Top 200 Questions & Answer
    Coupon code JSINTERVIEWHAPPY applied in below URL- 80% Discount
    www.udemy.com/...
    Don't worry if course not helping you, Udemy has 30 days Free Refund Policy.
    2. QUICK REVISION BOOK (PDF format)
    imojo.in/inter...
    50% Discount Applied on above link.
    Don't worry if book not helping you, I will return 100% of your money with in 7 days of purchase.
    Just mail me at anuragrawat123@gmail.com.
    All the best for your interviews.

Комментарии • 12

  • @shaiksameer2776
    @shaiksameer2776 8 месяцев назад

    Object.assign({},person) this will work if we dont have nested objects but where as for nested object we can use JSON.parse(JSON.stringify(person))

  • @shaiksameer2776
    @shaiksameer2776 9 месяцев назад

    please explain with arrays also deep copy and shallow copy

  • @rahulshaji5298
    @rahulshaji5298 6 месяцев назад

    nice and perfectly explained

  • @HetvikKarthikeya
    @HetvikKarthikeya 9 месяцев назад

    Functions inside objects are not working in deep copy, can you suggest deep copy with functions also should work

  • @sankaranarayanankm7049
    @sankaranarayanankm7049 5 месяцев назад

    instead of Object.assign() can i use spread operator ???
    and one more thing sir when i use this method but to change name only the value in copied object is changing why???

  • @tvsnmurthy2370
    @tvsnmurthy2370 9 месяцев назад

    Awesome❤

  • @vanamadinarendra2974
    @vanamadinarendra2974 9 месяцев назад

    Is it only for nested objects?

  • @princesstechideas
    @princesstechideas 4 месяца назад

    Nice 👍

  • @kosuribalaji317
    @kosuribalaji317 8 месяцев назад

    2:46 got it