I need to access the value of name key of the first object in this 2 object array. Using map() returns the value of both objects. How can I access the first one only?
let x = [ {name : 'A', age: 20}, {name : 'B', age: 21} ]
console.log(x.map(a => a.name))