Question: Javascript ES6 1. Use the .map() method on the heros array to return a new array. (5 pts) The new array should rename the 'name'

Javascript ES6

Javascript ES6 1. Use the .map() method on the heros array to

1. Use the .map() method on the heros array to return a new array. (5 pts) The new array should rename the 'name' key to 'hero' The 'name' key should not appear in the new array The new array should have a new key added called (id) The key 'id' should be based off the index const heros = [. { name: 'Spider-Man' }, { name: 'Thor' }, { name: 'Black Panther' }, { name: 'Captain Marvel' }, { name: 'Silver Surfer' } 1: EXPECTED OUTPUT (array of objects): { id: 0, hero: 'Spider-Man' }, { id: 1, hero: 'Thor' }, { id: 2, hero: 'Black Panther' }, { id: 3, hero: 'Captain Marvel' }, { id: 4, hero: 'Silver Surfer' }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!