Skip to content

Instantly share code, notes, and snippets.

@ktrysmt
Last active October 9, 2016 15:03
Show Gist options
  • Save ktrysmt/d7f21f46f36888ba1f83a569928750c4 to your computer and use it in GitHub Desktop.
Save ktrysmt/d7f21f46f36888ba1f83a569928750c4 to your computer and use it in GitHub Desktop.
Useful loop snipets in javascirpt.
var len = obj.length
for (var i= 0; i < len; i=(i+1)|0) {
console.log(obj[i])
}
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