ES6 Tutorial #9: Shallow vs Deep Copy| Interview Question| Modern Javascript 2021

  Рет қаралды 14,416

Nisha Singla

Nisha Singla

2 жыл бұрын

In this video, I have explained in detail, how to copy
javascript object and what is shallow and deep copy in javascript
Shallow copy is also identified by pass by Reference , when you
make a copy of original variable into another variable(copied) by using
assignment operator(=), that time only the reference address
of original variable is copied into another variable instead of original
values.
So at last both variables refer to the same value. So when you make any changes in
new variable if will also mutate or change the original variable
Deep Copy:
Deep copy is also identified by pass by Value, when you make a copy of
variable into another variable by using assignment operator, at that time
all the values(object, arrays) along with reference address of original variable
is copied into another variable.
At last, both variables refer to different referenced
values. So when you make any change in new variable it won't mutate the original variable.
Watch video on spread operator: • ES6 Tutorial #6: Sprea...
Watch video on mutable/immutable object : • ES6 Tutorial #5: Mutab...
I have one assignment at the end of the tutorial.
Please support my channel,🙏 by showing your love❤️ by liking and sharing my video, so that I can reach to more people and can help them too.
Watch my Angular playlist :
Angular : • Introduction- Angular ...
Follow me:
Facebook: / angularjs4beginners
LinkedIn: / nisha-singla-82407aa0
Instagram : / passion4code
For more such interesting videos, please subscribe to my channel and stay connected.
#javascript #NishaSingla

Пікірлер: 52
@dragons.2
@dragons.2 Ай бұрын
thanks sis💪🏻💯 i was struggling to understand deep vs shallow copy and watched many yt videos but you made it easy for me and now i understand it you're a lifesaver fr fr👌✨
@CodeWithJamil786
@CodeWithJamil786 5 ай бұрын
Awesome explained each and every concept.... Thank you...
@kunalrajput2234
@kunalrajput2234 Жыл бұрын
Well this was a deep explanation for my shallow js knowledge. Great video thanks
@EcomBusiness
@EcomBusiness Жыл бұрын
Thank You So much Mam. After witching other youtubers video I don't understand what is Shallow copy & Deep copy But Mam your video is so helpful me to understand the concept and all methods in Easy Way. Again Really Really Thank You!
@anjusreedharan3210
@anjusreedharan3210 2 жыл бұрын
Your videos are really informative and we can understand the concepts very clearly. Please add videos on ngRx and cookies in angular
@NishaSingla
@NishaSingla 2 жыл бұрын
Thank you … 😀🙏
@anupb540
@anupb540 Жыл бұрын
Thanks for this informative and easy to understand video..
@akiratoriyama1320
@akiratoriyama1320 2 жыл бұрын
Damn girl!! Those videos are super helpful!!!! Can't thank you enough!!!
@NishaSingla
@NishaSingla 2 жыл бұрын
Glad it helped :)
@tusarkantamallick5414
@tusarkantamallick5414 Жыл бұрын
thank you, for clear explanation
@ramadevi-xe4be
@ramadevi-xe4be Жыл бұрын
your explanation is excellent
@neerukondasandhya3432
@neerukondasandhya3432 2 жыл бұрын
Awesome explanation mam
@thahirakramthahirakram2275
@thahirakramthahirakram2275 6 ай бұрын
very nice explanation execellent
@rajeshkolluri448
@rajeshkolluri448 2 жыл бұрын
Thank you,Clean and clear explanation
@NishaSingla
@NishaSingla 2 жыл бұрын
Thank you 😊
@ehrazahmed8190
@ehrazahmed8190 2 жыл бұрын
Nice Explaination 👍.Good work👏.
@NishaSingla
@NishaSingla 2 жыл бұрын
Thank you 😊
@parmarsuresh2698
@parmarsuresh2698 Жыл бұрын
nice explanation ❤❤
@SAAMY_1414
@SAAMY_1414 2 жыл бұрын
Awesome Series :) (y) .. In this case if I want to update Country in copied Object ? I am trying to update in copiedvalue country value as 'US' (for example) , its creating a new key value with same pair .
@chanduBoddu
@chanduBoddu 2 жыл бұрын
Awesome explanation , thank you so much
@NishaSingla
@NishaSingla 2 жыл бұрын
😊😊
@chanduBoddu
@chanduBoddu 2 жыл бұрын
Today we faced same issue in prob , but fixed it Bec of ur video
@apurvakumar5881
@apurvakumar5881 2 жыл бұрын
thankyou mam for making my concept clear
@NishaSingla
@NishaSingla 2 жыл бұрын
Keep learning 😀
@apurvakumar5881
@apurvakumar5881 2 жыл бұрын
@@NishaSingla always mam
@VIVEKJOSHI05
@VIVEKJOSHI05 2 жыл бұрын
Good explanation.✌️
@NishaSingla
@NishaSingla 2 жыл бұрын
Thank you 😊
@shubhamkhilari6872
@shubhamkhilari6872 Жыл бұрын
This is crisp 🫡🫡
@kotireddy419
@kotireddy419 2 жыл бұрын
When to use shallow copy and deep copy ? Can you explain about this difference?
@jaffaji
@jaffaji 2 жыл бұрын
Nice voice. nice concept.
@NishaSingla
@NishaSingla 2 жыл бұрын
Thank you 😊
@ganesh56789
@ganesh56789 2 жыл бұрын
Thank you 🙏
@NishaSingla
@NishaSingla 2 жыл бұрын
😀👍🏻
@anupb540
@anupb540 Жыл бұрын
Nicely explained..understand the concept well..just a confusion, Object.assign() is giving partial deep copy, JSON.stringify() also giving partial deep copy...and use of spread operator is giving complete deep copy...so my question is which method is giving shallow copy...is shallow copy same as just assigning one object to another object or something else?
@kalpeshdashpute9598
@kalpeshdashpute9598 11 ай бұрын
referance data types like array and object have a by default shallow copy nature
@gayathrig6046
@gayathrig6046 2 жыл бұрын
Thanks.
@NishaSingla
@NishaSingla 2 жыл бұрын
You’re welcome 😀
@arpitsatyal8900
@arpitsatyal8900 2 жыл бұрын
You are amazing
@NishaSingla
@NishaSingla 2 жыл бұрын
Thanks 🙏
@arpitsatyal8900
@arpitsatyal8900 2 жыл бұрын
@@NishaSingla can you list all the important topics for an angular interview from your experience
@Looser_alpha
@Looser_alpha 2 жыл бұрын
make video on json method
@Adnan3035
@Adnan3035 2 жыл бұрын
Very well explained.
@mithunkumar5185
@mithunkumar5185 Жыл бұрын
With the help of this JSON.parse(JSON.stringify(object)); you can easily achieve the deep copy
@apurvakumar5881
@apurvakumar5881 2 жыл бұрын
i can able to do foe nested and simple objects FOR EX----- var obj = [{ x: 1 }, {y: 2}]; var deepCopy = _.cloneDeep(obj); // Changing orignal value obj[0].x = 10; // Values after changing original value console.log("After changing original value"); console.log("Original value ", obj); console.log("Deep Copy value ", deepCopy); OUTPUT Original value [ { x: 10 }, { y: 2 } ] Deep Copy value [ { x: 1 }, { y: 2 } ]
@NishaSingla
@NishaSingla 2 жыл бұрын
Cool 😎👍🏻
@ShravanKumar-kh2un
@ShravanKumar-kh2un Жыл бұрын
Good but you are using loadsh methods for it, she did it by using inbuilt es6 features
@kalyanideshmukh47
@kalyanideshmukh47 2 жыл бұрын
Thank you ma'am 😊
@NishaSingla
@NishaSingla 2 жыл бұрын
😀😀
@srinivasgangaraju2998
@srinivasgangaraju2998 Жыл бұрын
5:26
@Looser_alpha
@Looser_alpha 2 жыл бұрын
how much javacsript we would learn to land a job as a frontend developer please help me its an emergency
@NishaSingla
@NishaSingla 2 жыл бұрын
fundamentals should be clear...and it all depend for which role you are going even as frontend developer
@Looser_alpha
@Looser_alpha 2 жыл бұрын
@@NishaSingla to app hi bata do konse topic front-end developer as a fresher padhe
Shallow Copy and Deep Copy | Advanced Javascript Tutorial
26:36
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 70 МЛН
Каха ограбил банк
01:00
К-Media
Рет қаралды 2,2 МЛН
Китайка и Пчелка 4 серия😂😆
00:19
KITAYKA
Рет қаралды 3,7 МЛН
Deep Copy & Shallow Copy | Interview Question | JavaScript
45:15
Sheryians Coding School
Рет қаралды 10 М.
JavaScript Objects: Shallow and Deep Copy | All You Need to Know in 10 mins!
12:44
Javascript Array and Object Cloning: Shallow or Deep?
8:39
Jack Herrington
Рет қаралды 10 М.
JavaScript prototype in Hindi  | Examples | Interview Questions
27:31
Code Step By Step
Рет қаралды 30 М.
Increíble final 😱
00:37
Juan De Dios Pantoja 2
Рет қаралды 70 МЛН