Skip to content

Instantly share code, notes, and snippets.

@fabiomcosta
Created January 16, 2010 20:55
Show Gist options
  • Save fabiomcosta/279002 to your computer and use it in GitHub Desktop.
Save fabiomcosta/279002 to your computer and use it in GitHub Desktop.
// IE
var arrayFrom = Array.from;
try {
arrayFrom(document.html.childNodes);
} catch(e){
Array.from = function(item){
if (Type.isEnumerable(item)){
var i = item.length, array = new Array(i);
while (i--) array[i] = item[i];
return array;
}
return arrayFrom(item);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment