How to return a spread operator in a map arrow function in one line
This doesn't work
data = data.map(item => {...item, active: false});
When returning a literal object from an arrow function construct (a lambda), you have to wrap it in parentheses so that it's seen as an expression:
data.map(item => ({...item, active: false}));