Last Updated: February 25, 2016
·
586
· montanaflynn

Self-executing anonymous functions

Here's how you can have an anonymous function invoke itself:

(function() {
    console.log('self-executing anonymous function');
}());

2 Responses
Add your response

Also known as, Immediately Invoked Function Expressions (IIFE).

over 1 year ago ·

I, for one, welcome our Immediately Invoked Function Expression Overlords.

over 1 year ago ·