Object.assign ()

is there any other way to write it?
encountered shallow copy and deep copy problems today.
I"d like to ask if another way of writing object.assign can achieve the same effect. Do you?

Jul.27,2021

Hello, landlord! Try JSON.parse (JSON.stringify (obj)) ). This method can also be used for deep copy.


you can use object spread
such as const info = {name: 'leo', .this.props}


es2016
let objnew = {.name1, .name2, .name3};
console.log (objnew);

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-1ebb20a-485eb.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-1ebb20a-485eb.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?