function keyword, the return keyword, and the curly brackets.
This arrow function does the same thing as a regular function expression.
An arrow function uses the => symbol.
An arrow function is always written as a function expression.
Syntax
If the function body contains only one statement, you can remove the word function keyword, the return keyword, and the curly brackets.
|
|
|
Conventional Function |
Arrow Function |
|
|
|
|
“I don’t have a girlfriend, but I know a girl who’d be real mad if she heard me say that.” — Mitch Hedberg |