Last active
October 9, 2016 15:03
-
-
Save ktrysmt/d7f21f46f36888ba1f83a569928750c4 to your computer and use it in GitHub Desktop.
Useful loop snipets in javascirpt.
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 len = obj.length | |
for (var i= 0; i < len; i=(i+1)|0) { | |
console.log(obj[i]) | |
} |
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 = [] | |
i = 0; | |
while(i < arr.length) { | |
console.log(arr[i]) | |
i=(i+1)|0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment