Skip to content

Instantly share code, notes, and snippets.

@HamidOsouli-zz
Created November 10, 2018 22:24
Show Gist options
  • Save HamidOsouli-zz/a3ef308a9432173fe57463a25ef6bced to your computer and use it in GitHub Desktop.
Save HamidOsouli-zz/a3ef308a9432173fe57463a25ef6bced to your computer and use it in GitHub Desktop.
// There are other ways to enforce a function expression:
!function () { /* ... */ }();
~function () { /* ... */ }();
-function () { /* ... */ }();
+function () { /* ... */ }();
void function () { /* ... */ }();
//In contexts where an expression is expected, wrapping in parentheses is not necessary:
var f = function () { /* ... */ }();
true && function () { /* ... */ }();
0, function () { /* ... */ }();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment