var arraylike = document.getElementsByTagName('p')
//we cannot do ‘typeof arraylike’ because this returns ‘object’ not ‘array’
Array.isArray(arraylike) // false
var realArr = Array.prototype.slice.call(arraylike)
Array.isArray(realArr) //true
Created
January 16, 2015 18:29
-
-
Save awilson28/6ecbdfbb8b254254e699 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment