Map: Conditionally Set a Property in Array of Objects
Given an array of people objects, use
map
to create a new array where each object has a new property isAdult
.isAdult
should be true
if age
is 18 or older, and false
otherwise. The resulting array should not modify the original objects.Premium
JavaScript
Console