Skip to content

Instantly share code, notes, and snippets.

@jed
Created October 27, 2010 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jed/648670 to your computer and use it in GitHub Desktop.
Save jed/648670 to your computer and use it in GitHub Desktop.
is this code worth the 5 byte savings?
{1:"createElement",2:"createAttribute",3:"createTextNode",8:"createComment",11:"createDocumentFragment"}
",Element,Attribute,TextNode,,,,,Comment,,,DocumentFragment".replace(/\b\w/g,"create$&").split(",")
@isaacs
Copy link

isaacs commented Oct 27, 2010

Thumbs down.

The :"create bytes will be gzipped out anyway, and the first is better run-time performance.

@jed
Copy link
Author

jed commented Oct 28, 2010

indeed, i don't really know what i was thinking here...

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