The pattern is called self-invocation, a self-invoking function. It can create a closure, but that is an effect of the pattern (perhaps the intended effect), not the pattern itself.
More Related Contents:
- What is JSONP, and why was it created?
- What is the (function() { } )() construct in JavaScript?
- What is the purpose of a self executing function in javascript?
- Location of parenthesis for auto-executing anonymous JavaScript functions?
- What is the purpose of wrapping whole Javascript files in anonymous functions like “(function(){ … })()”?
- JavaScript plus sign in front of function expression
- Simplest/cleanest way to implement a singleton in JavaScript
- Comet and jQuery [closed]
- Function in JavaScript that can be called only once
- Sequencing ajax requests
- What is the correct term for variable shadowing in JavaScript?
- What is a practical use for a closure in JavaScript?
- How to implement inheritance in JS Revealing prototype pattern?
- Advanced JavaScript: Why is this function wrapped in parentheses? [duplicate]
- !function(){ }() vs (function(){ })()
- Singleton pattern in nodejs – is it needed?
- What is the difference between two declarations of module in javascript?
- Commonly accepted best practices around code organization in JavaScript [closed]
- Javascript: best Singleton pattern [duplicate]
- Dollar sign before self declaring anonymous function in JavaScript?
- When to use promise.all()?
- AngularJS: Understanding design pattern
- How does the (function() {})() construct work and why do people use it?
- Why would one use the Publish/Subscribe pattern (in JS/jQuery)?
- javascript: execute a bunch of asynchronous method with one callback
- Javascript mixins when using the module pattern
- why module pattern?
- Immediately-Invoked Function Expression (IIFE) In JavaScript – Passing jQuery
- What are the different ways of writing an IIFE? What are their use cases?
- Kyle Simpson’s OLOO Pattern vs Prototype Design Pattern