const target = { a: 1, b: 2 };
const source = { b: 4, c: 5 };
const returnedTarget = Object.assign(target, source);
console.log(target);
// !!!expected output: Object { a: 1, b: 4, c: 5 }
console.log(returnedTarget);
// expected output: Object { a: 1, b: 4, c: 5 }
let aaa = [1,2]
let bbb = [2,4]
const ccc=aaa.concat(bbb)
console.log(aaa)
//[1,2]
console.log(ccc)
//[1,2,2,4]
发表回复
要发表评论,您必须先登录。