Search⌘ K
AI Features

ES6 Arrow Functions

Explore ES6 arrow functions to write shorter and more readable JavaScript code. Understand the differences between block and concise bodies, including when parentheses and return statements are required. This lesson helps you make your React JSX more concise by using arrow functions effectively.

We'll cover the following...

JavaScript ES6 introduced arrow functions expressions, which are shorter than a function expressions.

Javascript (babel-node)
// function declaration
function () { ... }
// arrow function declaration
() => { ... }

You can remove the parentheses in an arrow function expression if it only has one argument, but you have to keep the parentheses if it gets multiple ...