Meaning of curly braces in array.map() [duplicate]
问题 This question already has answers here : Curly Brackets in Arrow Functions (2 answers) Closed 9 months ago . I have a .map() function that changes isActive property value of objects in data array. However wraps it with curly braces returns me undefined whereas wrapping it with parenthesis or no wrap returns the updated value. Curly braces are used as a wrapper in an arrow function but does it work differently for .map()? const newData = data.map((data) => { data.label === label ? { ...data,