Coding Ninjas Logo

Home > JavaScript Questions > What is an IIFE (Immediately Invoked Function Expression) in Javascript?

Q: What is an IIFE (Immediately Invoked Function Expression) in Javascript?



Answer:

An IIFE (Immediately Invoked Function Expression) is a JavaScript function that runs as soon as it is defined.

(function() { console.log('Hello'); })()

Similar Questions