Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Deep-copying in JavaScript. Parent comment
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
There are no comments on this comment yet.
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