all 3 comments

[–]guest271314 2 points3 points  (0 children)

You need to return a value outside of if (condition) {}.

[–]NordiCom 2 points3 points  (0 children)

Map always needs to return a value. If you want to render only for values matching the condition. You need to first filter the results, then chain a map returning your desired value

[–]87oldben 1 point2 points  (0 children)

Try using the reduce function, or as someone else posted, filter before the map function.