Created
August 17, 2010 17:33
-
-
Save cowboy/531016 to your computer and use it in GitHub Desktop.
with vs var
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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