Answers for "return destructured object"

8

destructuring objects

({ a, b } = { a: 10, b: 20 });
console.log(a); // 10
console.log(b); // 20


// Stage 4(finished) proposal
({a, b, ...rest} = {a: 10, b: 20, c: 30, d: 40});
console.log(a); // 10
console.log(b); // 20
console.log(rest); // {c: 30, d: 40}
Posted by: Guest on May-08-2020
0

destructure object exlude one

const myObject = {  a: 1,  b: 2,  c: 3};const { a, ...noA } = myObject;console.log(noA); // => { b: 2, c: 3 }
Posted by: Guest on December-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language