What I need to do is map over an Array and set a value to false on all of the objects. This was my first shot:
data = data.map((item) => {
item.active = false;
return item;
})
Works! But then there is Eslint, no-param-reassign. So I had to find something else. After some googling I found the spread operator! Awesome! I created this masterpiece:
data = data.map((item) => {
return {...item, active: false}
})
Looks cool and works as well. But then there is Eslint again, arrow-body-style. ok fine I will return the object on the same line:
data = data.map(item => {...item, active: false});
Dosn't work! :'( Am I missing something?