the following code works if i remove the curly braces on the callback function within the filter method. Can someone please explain why this is so or direct to learning resource?
filteredList = watchList.map((i)=>{
return {title: i["Title"],rating: i["imdbRating"]}
}).filter((i) => {i.rating >= 8});
does not work , but
filteredList = watchList.map((i)=>{
return {title: i["Title"],rating: i["imdbRating"]}
}).filter((i) => i.rating >= 8);
does with curly braces around {i.rating>=8} removed.
Iām looking to understand the concept. Thanks.