Created
October 20, 2022 23:51
-
-
Save sheppardjm/6ed88e16f34c11fc77de50ec2fd90881 to your computer and use it in GitHub Desktop.
Javascript Immediate invocation
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
//example declaration | |
(function() { | |
//do something | |
})(); | |
//alternative declaration | |
(function() { | |
//do something | |
}()); | |
//passing parameters | |
(function(a, b) { | |
//do something | |
})(some, values); | |
//return something | |
let x = (function(a, b) { | |
//do something | |
})(some, values); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment