self-executing-function Questions

21

Solved

In javascript, when would you want to use this: (function(){ //Bunch of code... })(); over this: //Bunch of code...
Retaliate asked 26/2, 2009 at 20:53

3

Solved

In JavaScript, it is possible to write a self-executing function like this: (function foo() { console.log("bar"); }()); I'm looking to do this in Java. So for example: // This code does not wo...
Fabe asked 18/6, 2014 at 16:34

1

Solved

How to using ES6 Arrow function to realize IIFEImmediately-Invoked Function Expression? Here is my demo codes, and it had tested passed! // ES 6 + IIFE (() => { let b = false; c...

2

Solved

Out of a window procedure, I'm writing a switch statement using self-executing lambdas, like this: LRESULT CALLBACK proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) { switch (msg) { case WM_CREA...

2

Solved

CodeMirror.net uses this construct (I'm simplifying slightly) to introduce the code for its JavaScript editor: (function(mod) { this.CodeMirror = mod(); })(function() { "use strict"; (15,000-o...
Ferreira asked 12/9, 2015 at 16:13

1

Solved

I'm trying to assign a constructor in a self-executing function in NodeJS. I'm pretty sure it's not working because my parameter is a variable pointing to module.exports, but I'm curious if there's...
Strabismus asked 13/2, 2015 at 19:44
1

© 2022 - 2024 — McMap. All rights reserved.