Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // using Array.map
- const heroes = [
- { fullName: pider-Man', herold: 1 },
- { fullName: 'Iron Man', herold: 2 },
- 15
- const alterEgos = [
- { fullName: 'Peter Parker', heroId: 1 },
- { fullName: 'Tony Stark', heroId: 2 },
- 1g
- const unmaskedHeroes = heroes.map(h = {
- const f = alterEgos.find(a = a.herold == h.herold);
- return {
- hero: h.fullName,
- alterEgo: f.fullName,
- Iig
- D)
- console.log({unmaskedHeroes});
Advertisement
Add Comment
Please, Sign In to add comment