Skip to content

Instantly share code, notes, and snippets.

@codesorter2015
Created November 2, 2019 04:13
Show Gist options
  • Save codesorter2015/68a5c12f098b7524c9951746eedcdcd3 to your computer and use it in GitHub Desktop.
Save codesorter2015/68a5c12f098b7524c9951746eedcdcd3 to your computer and use it in GitHub Desktop.
Example of IEF (Immediately Executing Function) in node
/*Immediately Executing Function:
You can execute a function immediately after you define it.
Simply wrap the function in parentheses () and invoke it
The reason for having an IEF is to create a new variable scope.
Example:
--------
*/
(function test() { console.log('test was executed!'); })();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment