Immediately invoked function expression: Difference between revisions

Content deleted Content added
m Reverted 1 edit by 2804:214:86E5:DBBF:1:0:9736:F3E7 (talk) to last revision by Yoshi24517
Heronils (talk | contribs)
Usage: Deleted a sentence. It is about types and about figuring out a type, which is unrelated to what this lemma tries to explain
Line 11:
(function () { /* ... */ }());
(() => { /* ... */ })(); // With ES6 arrow functions (though parentheses only allowed on outside)
</syntaxhighlight>
 
There are other ways to enforce a function expression:{{cn|date=September 2022}}
<syntaxhighlight lang="JavaScript">
!function () { /* ... */ }();
~function () { /* ... */ }();
-function () { /* ... */ }();
+function () { /* ... */ }();
void function () { /* ... */ }();
delete function () { /* ... */ }();
typeof function () { /* ... */ }();
await function () { /* ... */ }();
</syntaxhighlight>