Skip to content

Instantly share code, notes, and snippets.

@ymkjp
Created November 20, 2012 06:26
Show Gist options
  • Save ymkjp/4116372 to your computer and use it in GitHub Desktop.
Save ymkjp/4116372 to your computer and use it in GitHub Desktop.
Array.prototype.slice()
//Array.prototype.slice()
var nodeList = decument.getElementsByTagname('span');
alert(nodeList instanceof NodeList); // => true
alert(nodeList instanceof Array); // => false
var array = Array.prototype.slice.call(nodeList);
alert(array instanceof NodeList); // => false
alert(array instanceof Array); // => true
@ymkjp
Copy link
Author

ymkjp commented Nov 20, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment