Skip to content

Instantly share code, notes, and snippets.

@jcblw
Created May 26, 2013 00:39
Show Gist options
  • Save jcblw/5651329 to your computer and use it in GitHub Desktop.
Save jcblw/5651329 to your computer and use it in GitHub Desktop.
Tildes FTW
~function(){
console.log("Works!")
}()
@bjoshuanoah
Copy link

That looks a lot better than ! or +.

Is this compatible with ES3 as well? or just ES5?

@adrian-enspired
Copy link

?: you were talking about this (in general) at the meetup. Is there an advantage (or even a difference)? Yes, I agree it looks cool. But why do you prefer this over, say, (function( x ){ /* do something */ }( y ))?

@jcblw
Copy link
Author

jcblw commented May 26, 2013

@bjoshuanoah much cooler, I assume so since tilde is just an operator

@customanything I'll probably will still use the latter due to its ability to be compressed without warnings.

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