4 ms·
I'm pretty sure to program in Javascript you need to understand that primitives are passed as values, while objects are essentially passed by pointers, and if y
by lultimouomo 10y ago
I'm pretty sure to program in Javascript you need to understand that primitives are passed as values, while objects are essentially passed by pointers, and if you modify one inside the callee, the caller will see the modifications.
Understanding this fact does not strictly imply having a basic understanding of memory, but it gets pretty close to it. I would personally be weary of some who calls itself a programmer or software engineer and couldn't write this article themselves.
- paulddraper 10y agoPrimitives being passed by pointer or value....what is the difference? The only relevant parts is that (1) they are immutable and (2) they are compared by value.