Last active
February 11, 2024 20:36
-
-
Save dutchcelt/a9d01aaf65a54e1b956c to your computer and use it in GitHub Desktop.
Convert node lists to an Array
This file contains hidden or 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
/** | |
* Convert a list of nodes or arguments to an array. | |
* @param {object} list - Reference to a node or arguments. | |
*/ | |
var listToArray = function( list ) { | |
return [].map.call( list, function(element) { | |
return element; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment