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