const val1 = {key:'value'};
const val2 = deepCopy(val1);
function deepCopy(val){
return JSON.parse(JSON.stringify(val));
}
Go to list of users who liked
More than 3 years have passed since last update.
const val1 = {key:'value'};
const val2 = deepCopy(val1);
function deepCopy(val){
return JSON.parse(JSON.stringify(val));
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked