JavaScript function declaration vs Function expression vs Arrow function

preview_player
Показать описание
The function declaration defines a function with the specified parameters.
A function expression is very similar to and has almost the same syntax as a function declaration .

The main difference between a function expression and a function declaration is the function name, which can be omitted in function expressions to create anonymous functions.

An arrow function expression is a compact alternative to a traditional function expression, but is limited and can't be used in all situations.
Рекомендации по теме