📅  最后修改于: 2022-03-11 15:01:56.185000             🧑  作者: Mango
//// EXCLUDE OBJECT PROPERTY USING THE spread OPERATOR ////
const firstObject = {id: 0, firstName: 'John', age: 77 };
// take every property except age:
const {age, ...secondObject} = firstObject;
console.log(firstObject);
console.log(secondObject);
// { id: 0, firstName: 'John', age: 77 }
// { id: 0, firstName: 'John' }