Expressions

Arrow function expression

Try the free JavaScript compiler

Creates a callable function with lexical this and no own arguments binding. A concise expression body returns its value; a block needs return. Arrows are not constructible.

Formal Syntax & Structure

javascript syntaxjavascript
(parameters) => expression

Working Example

Example Snippetjavascript
const f=n=>n+1;console.log(f(8));
JavaScript Reference