Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created August 17, 2010 17:33
Show Gist options
  • Select an option

  • Save cowboy/531016 to your computer and use it in GitHub Desktop.

Select an option

Save cowboy/531016 to your computer and use it in GitHub Desktop.
with vs var
// Using `with` in this way will net 2N-3 bytes savings for N var
// declarations, but it sure makes using YUI compressor harder!
var m=Math,s=m.sin
with(Math)var s=sin
var m=Math,s=m.sin,c=m.cos
with(Math)var s=sin,c=cos
var m=Math,s=m.sin,c=m.cos,n=m.min
with(Math)var s=sin,c=cos,n=min
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment