Skip to content

Instantly share code, notes, and snippets.

@dutchcelt
Last active February 11, 2024 20:36
Show Gist options
  • Save dutchcelt/a9d01aaf65a54e1b956c to your computer and use it in GitHub Desktop.
Save dutchcelt/a9d01aaf65a54e1b956c to your computer and use it in GitHub Desktop.
Convert node lists to an Array
/**
* 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