Last active
August 29, 2015 14:14
-
-
Save colthreepv/3403d0dcb1c4417f9efe to your computer and use it in GitHub Desktop.
NodeList to Array
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
// 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