Arrow Function (JavaScript)
An arrow function is a short syntax for writing JavaScript functions using =>. Single-expression arrows return their value automatically.
JavaScript
Syntax
const name = (params) => expressionExamples
JavaScript
const add = (a, b) => a + b;
console.log(add(2, 3));Output:
5