scrimba
Frontend Career Path
Essential JavaScript concepts
Twitter Clone
Aside: forEach()
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AboutCommentsNotes
Aside: forEach()
Expand for more info
index.js
run
preview
console
const characters = [
{
title: 'Ninja',
emoji: '🥷',
powers: ['agility', 'stealth', 'aggression'],
},
{
title: 'Sorcerer',
emoji: '🧙',
powers: ['magic', 'invisibility', 'necromancy'],
},
{
title: 'Ogre',
emoji: '👹',
powers: ['power', 'stamina', 'shapeshifting'],
},
{
title: 'Unicorn',
emoji: '🦄',
powers: [ 'flight', 'power', 'purity'],
}
]

for (let character of characters){
console.log(character)
}

Console
{title:
"Ninja"
, emoji:
"🥷"
, powers:
[
"agility"
,
"stealth"
,
"aggression"
]
}
,
{title:
"Sorcerer"
, emoji:
"🧙"
, powers:
[
"magic"
,
"invisibility"
,
"necromancy"
]
}
,
{title:
"Ogre"
, emoji:
"👹"
, powers:
[
"power"
,
"stamina"
,
"shapeshifting"
]
}
,
{title:
"Unicorn"
, emoji:
"🦄"
, powers:
[
"flight"
,
"power"
,
"purity"
]
}
,
/index.html
-5:20