DEV Community

Discussion on: Function Declaration VS Function Expression In JavaScript

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

Also, a function expression does not have to be stored in a variable to be used, you can invoke it immediately. This is known as an 'immediately invoked function expression' or IIFE

(function (name) { console.log('Hello '  + name) })('World')
Enter fullscreen mode Exit fullscreen mode