3 ms·
> you could change what the reference was pointing to That's only true if you're passing the pointer by reference. That's different from passing the object its
by brundolf 6y ago
> you could change what the reference was pointing to
That's only true if you're passing the pointer by reference. That's different from passing the object itself by reference.
I did just look up the C++ semantics and learned something: technically reference-arguments don't have to be implemented by the compiler as pointers, though in practice they mostly are. So in that sense it's technically more correct to say that JS works with object pointers and not references. But we're really getting quite deep into the weeds at that point.
https://stackoverflow.com/questions/5893873/pass-by-reference-vs-pass-by-pointer#5893950 https://stackoverflow.com/questions/5893873/pass-by-referenc...