Skip to content

Instantly share code, notes, and snippets.

@gladchinda
Created July 30, 2018 23:27
Show Gist options
  • Select an option

  • Save gladchinda/b8567fa242875bb64abeed6bd9738cbd to your computer and use it in GitHub Desktop.

Select an option

Save gladchinda/b8567fa242875bb64abeed6bd9738cbd to your computer and use it in GitHub Desktop.
// FIRST FORM:
// Wrap the function expression in parentheses
// The invocation expression comes afterwards
(function(a, b) {
// ...function body here
})(arg1, arg2);
// SECOND FORM:
// Wrap the function expression together with
// the invocation expression in parentheses
(function(a, b) {
// ...function body here
}(arg1, arg2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment