Passing by reference vs. by value - JavaScript Tutorial

preview_player
Показать описание
In this video I'll be demonstrating the difference between passing by "reference" vs. passing by "value" in JavaScript.

To sum it up, arrays and objects are passed by reference whereas everything else is passed by value, and passing by value makes a copy of your data.

Support me on Patreon:

Follow me on Twitter @dcode!

If this video helped you out and you'd like to see more, make sure to leave a like and subscribe to dcode!
Рекомендации по теме
Комментарии
Автор

This really is the best explanation of this concept. Thank you so much!!

cy_theghost
Автор

Keep these flowing. Often enough we need to go back to basics :D

manuelcheta
Автор

watched many videos to understand this topic and yours is by far the BEST. Clear and simple cheers mate! greetings from Australia :D

nhiemtran
Автор

"A single instance to the array or the object." That's the important bit that makes this so much easier to understand👍🏿

GroudFrank
Автор

Thank you so much. It's one of the hardest concepts to explain in JavaScript but you did explain it the best way possible.

mohpish
Автор

Thank you so much. This was the simplest video/ explanation out there.

harryfox
Автор

Great explanation, a cool fact that functions only receive values, never reference. Although inside the function the argument can receive the object and point as well to it, as it was a object. But as rule, variables can receive both reference and value and function only can receive values.

mb_media
Автор

functions are objects in js, so that means functions are passed by reference in js, right?

drapala
Автор

Hi what's your vs code theme and font-family ?

cancevik
Автор

ho can we stop pass by reference in objects? how is it possible?

umairali