Last Updated: February 25, 2016
·
790
· 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 ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Related Tags
#javascript
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside