When we assign non-primitive value to the variable, we copy them by reference. In other words, variables are given a reference to that value, so they don’t actually contain the value.
This actually isn't true. The assignment operator assigns a value in all cases (for both objects and primitives). In the case of objects, the "value" is a memory address (a pointer). Learn more on that here in an article I wrote: Is JavaScript Pass by Reference?. This is how Chrome's v8 engine works, for example—the "references" are really just pointers under the hood.
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.
This actually isn't true. The assignment operator assigns a value in all cases (for both objects and primitives). In the case of objects, the "value" is a memory address (a pointer). Learn more on that here in an article I wrote: Is JavaScript Pass by Reference?. This is how Chrome's v8 engine works, for example—the "references" are really just pointers under the hood.