Created
June 19, 2018 05:30
-
-
Save mgmgpyaesonewin/2ab4a70e8a94b0080b4888aec50716f6 to your computer and use it in GitHub Desktop.
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 arr = [3, 5, 7]; | |
arr.foo = 'hello'; | |
for (var i in arr) { | |
console.log(i); // logs "0", "1", "2", "foo" | |
} | |
for (var i of arr) { | |
console.log(i); // logs 3, 5, 7 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment