Last active
October 7, 2016 08:04
-
-
Save savelee/b6f7ffded255b61c1ed2f91d742a74da to your computer and use it in GitHub Desktop.
ES2015 for of loop - https://www.leeboonstra.com/developer/sencha-ecmascript-2015/
This file contains 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
var array = [10, 20, 30]; | |
var map = new Map([["a", 1], ["b", 2], ["c", 3]]); | |
for (var i of array) { | |
console.log(i); | |
//10 | |
//20 | |
//30 | |
} | |
for (var entry of map) { | |
console.log(entry); | |
//Array [ "a", 1 ] | |
//Array [ "b", 2 ] | |
//Array [ "c", 3 ] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment