in javascript all things are passed by value, however in the case of an object the value that is passed is a refference to that underlying objects. So once we change location it changes all references to that location:
Example:
var obj1={
num:10,
name: "luka"
}
obj2 = obj1;
If we change:
obj1.num = 11;
then obj2.num also will be 11...
because we changed obj1.num and it's the location of the reference obj2.num also will be changed...
by Luka Tatarishvili
4 years ago
JavaScript
objects
0
Pro tip: use ```triple backticks around text``` to write in code fences