Reference Vs Value In JavaScript

preview_player
Показать описание
One of the most important topics in programming is pass by reference vs value. It is something that is incredibly confusing to follow, and can lead to many bugs until you understand it. In this video I am going to make the learning process as quick and easy for you, so you can spend your time coding instead of stuck debugging reference errors. In order to accomplish this we will be going over an in depth visual example of how values and references work in simple code, before we jump into some live coding examples of reference and value passing.

🧠 Concepts Covered:

- What is reference passing
- What is value passing
- The difference between values and references
- How references are shared
- What a memory address is
- How references and values work with functions

🌎 Find Me Here:

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

Thank you! I was struggling with this concept, but now I understand it. Passing by value is like if I were to draw a picture, then make a paper copy of it and give it to you. We have two different sheets of paper, even though they look identical, so if you draw on it or cut it up, it doesn't modify mine at all. On the other hand, passing by reference is like using a Google Doc shared with a link. We both use the link to view the same single document, so if you make changes to the document, I can see them too.

taragilesbie
Автор

I've been studying for 7 months and I finally understand this *crying*

warrentait
Автор

I never realised why arrays could be const variables before. It's because the memory reference is constant and its just the value stored in the memory that changes! Thanks Kyle!

makamaka
Автор

Good stuff. And this why, when you check the MDN docs for methods to perform on arrays/objects (e.g. slice, splice), they tell you whether or not a NEW object is returned. That way you can choose the appropriate method. More often than not, returning an object (and not overwriting the old) is the pattern used for non-primitives.

nerdiloo
Автор

Hey Kyle! Thank you very much. You have cleared my doubt about one of the most confusing topics in programming. Thank you Sir!

santra
Автор

You seriously have a gift for taking complicated concepts and explaining them so clearly.

HeatherLeigh
Автор

this content is like... SO IMPORTANT! So many bugs are caused by mistakes involving this ;-;

ghabrielmielli
Автор

Hey, thank you for such a great and informative video. Every second of it was a pure gold for me.

ZZZZ
Автор

Thank you so much for making this video. I was having a hard time trying to understand this topic but your explanation was so clear I got it all right!

michellesalas
Автор

A really good explanation, crystal clear. You’re a great teacher Kyle ! 👍

anonymous.youtuber
Автор

You're a smart kid always give great content and you have a great way of delivering!!! Thanks a lot form a student programmer struggling to learn javascript. 5 months in but we're getting there!!!

vonshitz
Автор

Thank you! Finally object references are starting to become clear.

linuslexy
Автор

Bro, I am a very visual learner and this helped tons. For some reason, this concept was really confusing me, but this made it click. I can't thank you enough.

stevieholland
Автор

This has been one of JavaScript's "Gotchas". 😀 Thank you. ❤️

hyfydistro
Автор

I could not even find such words to thank you, to be honest nobody ever could explain me so easy, you are the best teacher, please keep recording, more and more videos from you, even more likes from us )) P.s. hello from Armenia )))

LS
Автор

This was the most informative thing I could find in trying to understand pass by reference, thank you!

lesbiancake
Автор

I didn't manage to get all this because everything was happening in background. You cleared all of my doubts regarding this. I thought I'd master JavaScript concepts by my own in less time but it does take time to understand such type of concepts. I've gone through articles and videos but couldn't find any video this much explanatory. Thank you man!

tusharcreates
Автор

thank you. I'm a junior dev and i've been using React for the past 6 months and i never really learned the bases, this really is important

highallthetime
Автор

Awesome how simple you clarify this difference

Easy to understand and so important indeed

Thank you so much

liveyourdreamsdotbe
Автор

been studying javascript for 1 month and this made it clear for me thank you Kyle best teacher !

DojoDyo