Arrow function (=>)
Short function syntax.
Syntax
const name = (p) => expression;
Description
Short function definition without writing function. If there is a single expression, { } and return are not needed. Frequently used in places like map/filter.
Example
Loading editor…
Expected output
36
When to use?
Short helpers, arguments for array methods.