I'm still a newbie with javascript. I'm facing a problem with mapping an array. I don't know how to return the an array with objects.
This is the initial array:
array1 = [{firstName: "Harry"},
{lastName: "Potter"}];
When i do array1.map, it returns:
array1 = ["Potter"];
I want to make array1 to be like this after mapping the lastName:
array1 = [{lastName: "Potter"}];
.mapcallback that would result in thatfirstNameandlastNamekeys on one object?