exposir / TIL

📝 Today I Learned
https://exposir.github.io/blog/
4 stars 0 forks source link

对象及其方法 #65

Closed exposir closed 2 years ago

exposir commented 3 years ago

Object.assign()

const a = { a: 1, b: 2 };
const b = { b: 4, c: 5 };
const c = Object.assign(a, b);
console.log(c); //  {a: 1, b: 4, c: 5}