Skip to content

Instantly share code, notes, and snippets.

@Fedia
Created January 20, 2016 21:39
Show Gist options
  • Save Fedia/a245b74eda6f4036a013 to your computer and use it in GitHub Desktop.
Save Fedia/a245b74eda6f4036a013 to your computer and use it in GitHub Desktop.
/**
* Batshit crazy DOM serializer in 140byt.es fashion (138)
* Ships with a predefined limit of 99 childNodes
*
*/
function (a,b,c){for(b=Array(99),c=0;c<99;b[c]=c++);return JSON.stringify(a,['nodeName','nodeValue','attributes','childNodes'].concat(b))}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment