DEV Community

Discussion on: Function Declaration VS Function Expression In JavaScript

Collapse
 
marzelin profile image
Marc Ziel

A function expression can have a name but it's not required. When it has a name you can use it in the function body (handy for recursion).

Also, when you create function expressions with const or let they're hoisted but they aren't initialized as the error says.