After the js reference type value is assigned, it does not affect the previously assigned

after the reference type is assigned, changing one of them will affect the other, as follows:

var obj1 = { name: "hello" };
var obj2 = obj1;
obj2 = {};
console.log(obj1); // {name: "hello"}
console.log(obj2); // {}
Jun.15,2022
The

variable is re-assigned as a whole, which is equivalent to reopening a piece of memory. The memory pointer has changed. It has nothing to do with the original


, followed by a direct change in the direction of the variable, without manipulating the reference object.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e89ea1-46d77.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e89ea1-46d77.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?