3 ms·
Again, everything in JS is passed by value - it's not even debatable. Variables pointing to JS objects and arrays are passed by value the same as variables poin
by filleduchaos 7y ago
Again, everything in JS is passed by value - it's not even debatable. Variables pointing to JS objects and arrays are passed by value the same as variables pointing to strings or numbers. The value of the variable is always copied. However, JS objects and arrays are reference types, so the value that is copied is simply a reference to the same data.
I can't really relate, but I do understand that the distinction between evaluation strategy and reference/value types might be a bit difficult for programmers who've never actually had to deal with either concept to grasp, though.