does it duplicate it for the function to use or it makes reference back to the actual variable value?
Looking at it from memory and performance perspective
You can test: function change(obj) { obj.foo = 4; } const myObj = { bar: 8 }; change(myObj); // if it was duplicated, the original shouldn't change console.log(myObj);
Обсуждают сегодня