JavaScript · Language basics

Arrow function

A concise function expression. It does not bind its own this or arguments.

Syntax
(a, b) => a + b

Example

Try it

Notes

Use a normal function when you need dynamic this, such as object methods.

More in this group

Chained comparison Comma operator Default parameter destructuring for…in for…of Function declaration if / else

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course