Yes, objects are passed by reference, but there are no pointers in JavaScript. We can't have direct access to memory addresses like in C language.
I wrote a mini-post describing how references in JS work with objects. By walking through a simple example, it shows that a variable can't reference another variable.
It is not important if language provides access to memory or not. Pointer is always address to some space occupied by data regardless of programming language.
If you will have one object and this object you will put into 500 arrays, you still have only one object on the same address (on the same pointer).
So we can say that even javascript has pointers/addresses.
I agree that under the hood there are pointers, memory allocation, e.t.c. I mean that JavaScript doesn't have syntax to work pointers directly and allocate/free memory like it's done in C or similar languages.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes, objects are passed by reference, but there are no pointers in JavaScript. We can't have direct access to memory addresses like in C language.
I wrote a mini-post describing how references in JS work with objects. By walking through a simple example, it shows that a variable can't reference another variable.
References in JavaScript
Eugene Karataev ・ May 7 ・ 1 min read
It is not important if language provides access to memory or not. Pointer is always address to some space occupied by data regardless of programming language.
If you will have one object and this object you will put into 500 arrays, you still have only one object on the same address (on the same pointer).
So we can say that even javascript has pointers/addresses.
I agree that under the hood there are pointers, memory allocation, e.t.c. I mean that JavaScript doesn't have syntax to work pointers directly and allocate/free memory like it's done in C or similar languages.