DEV Community

Discussion on: Anonymous Functions vs Named Functions vs Arrow Functions

Collapse
 
badgamerbad profile image
Vipul Dessai

here the IIFE syntax is incorrect, i.e. the round brackets around the arrow function are missing

// Embedded into console.log fails
console.log(((count) => {
     return ("Arrow: I can do " + count + " pushups")
})(30)) // Arrow: I can do 30 pushups
Enter fullscreen mode Exit fullscreen mode