Last active
November 14, 2017 21:48
-
-
Save aderaaij/1e9e1e013ea4b13bb98c0a0eccdc9a1e to your computer and use it in GitHub Desktop.
The for...of statement creates a loop iterating over iterable objects (including Array, Map, Set, String, TypedArray, arguments object and so on), invoking a custom iteration hook with statements to be executed for the value of each distinct property.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const heroes = ['The Hulk', 'Black Widow', 'Vision', 'Thor']; | |
for (const hero of heroes) { | |
if(hero === 'Black Widow') { | |
break; | |
} | |
console.log(hero); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment