remove a field from object with spread operator code example
Example: destructure object exlude one
const myObject = { a: 1, b: 2, c: 3};const { a, ...noA } = myObject;console.log(noA); // => { b: 2, c: 3 }
const myObject = { a: 1, b: 2, c: 3};const { a, ...noA } = myObject;console.log(noA); // => { b: 2, c: 3 }