this is the gist of the issue, fetched from http://javadude.com/articles/passbyvalue.htm about java but exemplifies perfectly the pass by reference semantics:
"If you can write such a method/function in your language such that calling
Type var1 = ...; Type var2 = ...; swap(var1,var2); actually switches the values of the variables var1 and var2, the language supports pass-by-reference semantics."
as java javascript is reference-by-value
this is the gist of the issue, fetched from http://javadude.com/articles/passbyvalue.htm about java but exemplifies perfectly the pass by reference semantics:
"If you can write such a method/function in your language such that calling
Type var1 = ...; Type var2 = ...; swap(var1,var2); actually switches the values of the variables var1 and var2, the language supports pass-by-reference semantics."
as java javascript is reference-by-value