Это видео недоступно.
Сожалеем об этом.

JavaScript Object Clone | Deep and Shallow Copy in Hindi | Interview Questions

Поделиться
HTML-код
  • Опубликовано: 3 мар 2022
  • In this javascript object deep copy and shallow copy tutorial, we learn to clone object in javascript and we learn about deep copy of object and shallow copy of object . this video made by anil Sidhu in Hindi language
    Steps
    what is object clone in hindi
    why we need object clone
    type of object clone
    Example
    deep copy of object
    shallow copy of object
    Interview Questions
    React js Latest Playlist in hindi : • React tutorial for beg...
    inst id: @code.steps

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

  • @Satyamsingh-fw4mh
    @Satyamsingh-fw4mh Год назад +21

    1. Objects are copied by reference and variables by value.
    2. To copy objects by value:
    ==>Object.Assign({}, obj)
    ==>{...obj}
    3. The above method is shallow copy. It copies only top-level fields.
    4. To copy nested objects, deep copy comes into picture.
    ==>JSON.parse(JSON.stringyfy(obj));
    5. But the above doesn’t copy functions and dates. So, loadash is used.
    ==>_.cloneDeep(obj)

  • @travel2react567
    @travel2react567 2 года назад +15

    Before watching this video, I was having a lot of confusion about deep copy and Shallow copy but now it's crystal clear. Thanks a lot. Your teaching style is awesome.

  • @inspiredomkar1239
    @inspiredomkar1239 11 дней назад

    Insightful video.Everything got crystal clear thank you.!

  • @yashwani8155
    @yashwani8155 Год назад +2

    I don't know how to thank you man!!! I was stuck on a bug for like 24 hours due to this problem....Thanks you loads!!! liked and subscribed!!!

  • @awaisahmad8935
    @awaisahmad8935 22 дня назад

    Hi tutor your Urdu accent is unique and guaranteed quality concept also makes your channel awesome. speak English where necessary because urdu is my mother tongue easy to understand.

  • @praveenbehera1307
    @praveenbehera1307 Год назад +1

    Finally!!! I am able to understand Shallow and Deep copy. Thank you

  • @SajithaKSoman
    @SajithaKSoman 3 месяца назад

    Thank you sir . thank you .After a long time , I understand the concept of deep copy and shallow copy from this video.

  • @ashutoshshrivastava57
    @ashutoshshrivastava57 2 месяца назад

    Very awesome explanation sir.

  • @vartikaJoshi-en4he
    @vartikaJoshi-en4he 8 месяцев назад +1

    Amazing explanation..best explanation in RUclips for this topic .

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

    Awesome explaining sir shallow copy and deep copy.its very helpfull video thank you so much

  • @aritradas8606
    @aritradas8606 Год назад +1

    Just brilliantly explained. Very apt, systematic and well defined. Removed all my confusions forever!

  • @supergameras2936
    @supergameras2936 3 месяца назад

    You are great sir your videos very helpful and You always talk about the important things, you don't prolong the conversation. Thanks

  • @amanverma7977
    @amanverma7977 Год назад +1

    Thank you so much, simplest explanation

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

    Great explanation thanks.

  • @aakashujjainwal7147
    @aakashujjainwal7147 Год назад

    thank you bro it was really helpful ..mere bhot sare confusion dur ho gye ....keep learning & keep teaching us ...best of luck bro

  • @mohitkumar-zd9pv
    @mohitkumar-zd9pv Год назад +2

    made it so easy, keep up...

  • @akashtiwari3358
    @akashtiwari3358 2 года назад +2

    what a explaination👏gudluck brother

  • @beautyofworld1700
    @beautyofworld1700 Год назад

    keet it up. best explaination.

  • @mayurchaudhari4239
    @mayurchaudhari4239 7 месяцев назад

    Well done master khup mast

  • @harshvardhan7718
    @harshvardhan7718 Год назад +1

    Thanks for this video sir. Bt humlog fresher hai to samjhane ke tym thoda sa dhire samjhenge to aur bahetar hoga. Again saying nice video sir keep it up.
    Dhannebad....☺

  • @rajnisrivastav1599
    @rajnisrivastav1599 2 года назад +5

    The best explanation one could have asked for. I just have one question what if the Interviewer ask which is better Deep copy or shallow copy?

    • @codestepbystep
      @codestepbystep  2 года назад +4

      They can not ask which one is better. We choose copy type over requirement

  • @mr.wazirgaming2696
    @mr.wazirgaming2696 2 года назад +1

    It's so cleared now ❤️👍 about objects. Thanks 😊

  • @sudhirmohanty5971
    @sudhirmohanty5971 Год назад +4

    I have a question regarding shallow copy please explain. U told 8:11 that in shallow copy means value of a object is copied not the reference . But when i search in google there i found inside bracket (In Shallow copy, a copy of the original object is stored and only the reference address is finally copied. ).
    please sir clear this to me

  • @ermahesh2009
    @ermahesh2009 Год назад

    Bhai itte aache se samjata hai practice ki jarorat bhi nahi padi sidda ghus gaya dimag mai.

  • @UdayPawarUdi
    @UdayPawarUdi Год назад

    Very nice teaching. Very good way of explanation.

  • @Nitesh_Arya77
    @Nitesh_Arya77 10 месяцев назад

    Great explanation sir

  • @imnawasthi
    @imnawasthi Год назад +1

    paji Bht hi sahi explain kita tusi att krti, paji ik question a ki same cheej arrays nal b hundi a ?

  • @VISHNUKUMAR-eg1he
    @VISHNUKUMAR-eg1he 5 месяцев назад

    Really nice explanation step by step ❤

  • @SonuKumar-uq2rb
    @SonuKumar-uq2rb Год назад

    very well explained thanks

  • @abhishekrai215
    @abhishekrai215 Год назад

    now cristal clear about deep and shallow thankyou so much bhaiya g

  • @dhananjayrakshe7655
    @dhananjayrakshe7655 Год назад

    I saw lots of video but i also get confusion in shallow and deep copy but in this video i understand total about that. Nice work buddy...!

  • @Code_with_random
    @Code_with_random Год назад

    Good explanation easy to understand

  • @ajitrana3158
    @ajitrana3158 Год назад

    Thnx sir aapke batane ka trika bhut ache h I like it

  • @rutvikbhatt6654
    @rutvikbhatt6654 2 года назад +2

    Very helpful ☺️ 👍

  • @zeeshanahmad1675
    @zeeshanahmad1675 2 года назад +4

    Rather then going to browser console all the time
    Y dont you try { node (name of the JS file) } and press enter
    in your vs code terminal
    it will be more helpful

  • @tejusgroup6695
    @tejusgroup6695 2 года назад

    concept is clear sir.. thanks for teaching in a simple way.. Happy coding

  • @razasaleem1154
    @razasaleem1154 Год назад +1

    Just preparing for an interview and it helped me a lot, thanks man ♥️

  • @TarunKumar-ds7ti
    @TarunKumar-ds7ti Год назад +1

    thanks bro itna deep me batane ke liye

  • @AshrafAli_SoftwareDev
    @AshrafAli_SoftwareDev 2 месяца назад

    No scope to dislike the video. Nice explanation 10/10

  • @vikkaguru7712
    @vikkaguru7712 2 года назад +1

    bahut khub bhai ji

  • @snehakamble229
    @snehakamble229 2 месяца назад

    very well explained. thank you

  • @aakash261
    @aakash261 Год назад

    your explanation is easy and awesome, my concept got cleared thank you 👍

  • @rahilkhan6551
    @rahilkhan6551 2 года назад +1

    great video
    define in well way

  • @ScriptyVijay
    @ScriptyVijay Год назад

    Sir bohot dino bad channel mila bawal hi padha rhe ho app 🙏🏻 1:27

  • @emanrazzak1072
    @emanrazzak1072 Год назад

    Alhamdulillah all confusion cleared now

  • @prajwalnayak214
    @prajwalnayak214 Год назад

    Best explanation ever made!

  • @SonuKumar-uq2rb
    @SonuKumar-uq2rb Год назад

    very good keep it up bro

  • @surajprakash2760
    @surajprakash2760 11 месяцев назад

    Thank you so much , you explain us in very simplest way. 😊

  • @shawonbiswas9082
    @shawonbiswas9082 2 года назад

    I am soo happy with your concept 😍 just e bolna chatahu aiiisa bahut sara interview question chaiye jojo question pucha jatahe

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

    Nice Explaination

  • @user-cn9jz2bx3c
    @user-cn9jz2bx3c 10 месяцев назад

    very impressive explanation . thanku sir

  • @Rajeevkumar-sx3er
    @Rajeevkumar-sx3er Год назад

    Really good video bro

  • @sugandhaparasher8861
    @sugandhaparasher8861 11 месяцев назад

    Very well Explained. thank you .

  • @gulrezeqbal3048
    @gulrezeqbal3048 Год назад

    one of the great explanation

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

    v nice sir.... amazing.... thank you...

  • @subhadeepghosh2813
    @subhadeepghosh2813 Год назад

    maza aa gya🎉🎉🎉🎉🎉❤❤❤❤❤❤❤

  • @pritamkeshri8389
    @pritamkeshri8389 Год назад

    Nice explanation

  • @rajendra_K_
    @rajendra_K_ 11 месяцев назад

    @Anil thank you very much explaining complex topics in a such a easy way :)

  • @physicsazamgarh5731
    @physicsazamgarh5731 Год назад

    the best🙏🙏🙏🙏🙏

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

    helpful brother

  • @sumantripathii431
    @sumantripathii431 2 года назад +1

    Nyc clear concept

  • @vishalrindhe4025
    @vishalrindhe4025 Год назад

    Best ever explanation 🤩

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

    ❤❤❤❤useful

  • @shailenderjaiswal1685
    @shailenderjaiswal1685 Год назад +1

    sir you were using spread operator not destructuring in shallow copy

  • @abhishektaur
    @abhishektaur 11 месяцев назад

    good explation

  • @ajaychimanpure7010
    @ajaychimanpure7010 Год назад

    Very well Explained Anil..!!☺️

  • @ramzanchaudhry3999
    @ramzanchaudhry3999 10 месяцев назад

    amazing bro . well explained 👍

  • @lokeshawasthi6640
    @lokeshawasthi6640 17 дней назад

    amazing class

  • @AhmadAli-no6bw
    @AhmadAli-no6bw 2 года назад

    You are the best.

  • @taniajebin8437
    @taniajebin8437 Год назад

    Thanks a lot

  • @tusharshrivastava7184
    @tusharshrivastava7184 2 года назад +1

    Please make video of oops in js

  • @BeastUn
    @BeastUn Год назад

    thANK U FOR THIS GREAT EXPLANATION

  • @sanjanaprajapati9707
    @sanjanaprajapati9707 Год назад

    Really good explanation 👍

  • @chetanpatil9917
    @chetanpatil9917 Год назад +1

    This is an underrated channel. All these awesome videos should reach to more people.
    Do Like and subscribe this channel

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

    superb

  • @millwoodfurnace2739
    @millwoodfurnace2739 Год назад

    Nice Explanation!!!!!

  • @amittiwari4163
    @amittiwari4163 2 года назад +2

    Very nice sir but pls share this with us

  • @hackerwhite7957
    @hackerwhite7957 2 года назад +1

    Helpful video

  • @ravi_pk
    @ravi_pk Год назад

    Nice sir

  • @ashitoshpatil8678
    @ashitoshpatil8678 Год назад

    bind call apply use nhi kar sakte kya fir methods ke liye jo bhi obj mai present
    hai

  • @ashishagrawal8975
    @ashishagrawal8975 Год назад

    Your video is helpful for me so can you please make video for Oops in JavaScript...thank you

  • @jagdishjena9058
    @jagdishjena9058 2 года назад

    Keep on making these interview questions.

  • @thersh4882
    @thersh4882 3 месяца назад

    Wowww

  • @talibhusain3335
    @talibhusain3335 Год назад

    Wow💐

  • @subhamdudheria9523
    @subhamdudheria9523 2 года назад +2

    Does the same thing goes with array?

  • @prashantmestry699
    @prashantmestry699 2 года назад

    nice explanation on this topic.

  • @jagdishjena9058
    @jagdishjena9058 2 года назад

    Thank you so much sir.

  • @kamaal2110
    @kamaal2110 2 года назад

    so what then if we have a object and it properties with function and we have to copy it by `let obj2 = Object.assign({}, obj1);` and modified one property value in obj2 so it will be shallow copy or deep copy???

  • @azanraja5089
    @azanraja5089 Месяц назад

    if we put an console in between like:-
    let obj = {
    name: "peter",
    };
    console.log(obj);
    let user = obj;
    user.name = "hello";
    console.log(obj);
    than the result is
    peter
    hello
    why it already update the obj value than why the peter prints
    why the hello not prints 2 times

    • @Nishantsingh-ys5cm
      @Nishantsingh-ys5cm 13 дней назад

      bro the output is correct because you console.log('obj') before copy it to the user.

  • @ChetanPednekar
    @ChetanPednekar Год назад

    Nice example & explanation Anil. Thanks!
    Just wanted to confirm if we can call (...) three dots as a 'spread' operator instead of 'de-structuring' ?

  • @ehtixhamamjad
    @ehtixhamamjad Год назад

    please explain Array.prototype.slice & JSON.parse(JSON.stringify(obj))

  • @rehanhaq3564
    @rehanhaq3564 2 года назад +1

    This keyword or event loop

  • @VinayTandale
    @VinayTandale Год назад

    sir destructing method can be used? let user=[obj] and then we can change both values? is this feasible to use

    • @codestepbystep
      @codestepbystep  Год назад +1

      destruction will do only shallow copy not deep

    • @VinayTandale
      @VinayTandale Год назад

      @@codestepbystep it helped me for todays interview sir....😊😊😊i have watched complete tutorial of mern and it helped me a lot....i hade made notes of your all videos....and while making projects i use it a lot....Sir websockets and tensorflow js if possible...❤️❤️❤️it helped me a lot

  • @Growfacts
    @Growfacts 2 года назад

    Great❤️❤️❤️

  • @mohitkumar-zd9pv
    @mohitkumar-zd9pv Год назад

    What is the difference between deep copy/shallow copy and deep cloning/shallow cloning, are they same?

  • @nikleshniks
    @nikleshniks 2 года назад

    😃Like to bantaa hai Boss😃
    Really, amazing & to much concepts have been cleared

  • @pujamohanty8825
    @pujamohanty8825 2 года назад +1

    👍

  • @rahulthakur-rb6xz
    @rahulthakur-rb6xz 2 года назад +1

    Thank you aap mat boliye balki hame bolne dijiye
    Thank you

  • @sourabhgera1364
    @sourabhgera1364 11 месяцев назад

    Definition Shallow copy and deep copy ?

  • @sakshampethkar8970
    @sakshampethkar8970 Год назад

    Javascript symbols like NaN bhi nhi honge deep copy