add glossary/Value-vs-reference

This commit is contained in:
Stefan Feješ
2018-07-18 11:16:17 +02:00
parent 9432d6d936
commit 88bff99a40

View File

@ -0,0 +1,5 @@
### Value vs reference
When passing by value we pass a copy of actual variables in the function as a parameter.
When passing by reference we pass a memory address of actual variables in function as a parameter ,therefore any modification on parameters inside the function will reflect in the actual variable.
In JavaScript primitive values are passed by value while objects are passed by reference.