Skip to content

Instantly share code, notes, and snippets.

@colthreepv
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colthreepv/3403d0dcb1c4417f9efe to your computer and use it in GitHub Desktop.
Save colthreepv/3403d0dcb1c4417f9efe to your computer and use it in GitHub Desktop.
NodeList to Array
// credits to: http://stackoverflow.com/questions/3199588/fastest-way-to-convert-javascript-nodelist-to-array
function toArray (nl) {
var l=nl.length, arr = new Array(l);
while(l--){arr[l]=nl[l];}
return arr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment