3 ms·
This has nothing to do with JavaScript, this is basics of pass-by-reference in garbage collected languages. Hint: only primitives are "copied" into functions, o
by the_gipsy 14y ago
This has nothing to do with JavaScript, this is basics of pass-by-reference in garbage collected languages. Hint: only primitives are "copied" into functions, objects are references; {}, [] and new Foo are all objects in JavaScript.