by
4,758 17
1
4
251k
2
Top 1% !
Popular
Pearl of Wisdom
Specified
Popularity: 5360th place
No tags for this snippet yet.
LanguageJavaScript
LicenseMIT_X11
SourceGitHub

Object forEach

Object forEach: 
forEach.js
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/385051/Object-forEach?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
var friends = ["Mike", "Stacy", "Andy", "Rick"]; friends.forEach(function (eachName, index){ console.log(index + 1 + ". " + eachName); // 1. Mike, 2. Stacy, 3. Andy, 4. Rick​ });
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus