3 ms·
You might have missed the main thread pointing out that your claim that "JavaScript passes everything by reference" or is call by reference is wrong in every wa
by ghusbands 9y ago
You might have missed the main thread pointing out that your claim that "JavaScript passes everything by reference" or is call by reference is wrong in every way. Javascript is call by value, those values can be strings, numbers and references to objects and arrays and such. "Call by reference" is very specific terminology that means that when you run somefunction(n), the caller's variable, n, might get entirely changed, even if it's just a number.