Last active
April 19, 2021 01:37
-
-
Save jlggross/233bdc2cacbf9148c1157f123d41f75d to your computer and use it in GitHub Desktop.
IIFE Example
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
var a = (function () { | |
var name = "João" | |
return name | |
})() | |
console.log(a) // "João" | |
var b = (function () { | |
console.log("----") | |
})() | |
console.log(b) // undefined - there is no return to b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment