Skip to content

Instantly share code, notes, and snippets.

View BobChubby's full-sized avatar

James Curry BobChubby

View GitHub Profile
@BobChubby
BobChubby / toArray.js
Last active April 19, 2016 05:42
toArray method to convert NodeLists to normal Arrays
// Example:
// document.getElementsByTagName('p').toArray().map(function(tag) { return tag.innerText }).join("\n");
NodeList.prototype.toArray=function(){for(var i=0,a=[],t=this;i<t.length;i++)a.push(t[i]);return a;}

Keybase proof

I hereby claim:

  • I am BobChubby on github.
  • I am bobchubby (https://keybase.io/bobchubby) on keybase.
  • I have a public key whose fingerprint is E76A 0247 8CC9 D4A3 E3A3 EF1B 2EFC 5848 B09D 0708

To claim this, I am signing this object: