Created
November 2, 2019 04:13
-
-
Save codesorter2015/68a5c12f098b7524c9951746eedcdcd3 to your computer and use it in GitHub Desktop.
Example of IEF (Immediately Executing Function) in node
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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