Neeh Help About Destructuring Assignment

// This is my question

I know this is a code about Destructuring Assignment. but can someone tell me why there are 2 round brackets in this code
({a, b, ... rest} = {a: 10, b: 20, c: 30, d: 40}) ;

// Code

({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}

The parentheses (what you’re calling “round brackets”) aren’t actually necessary in this case. FCC challenges don’t always use minimal syntax in their sample code.

1 Like