javascript
javascript
Arrow Function in Javascript
Live
bolt
Level1
Progress0%

Arrow Function in Javascript

CARD 1

Introduction

Login to report note issues for this section.

Arrow Functions

An arrow function is a shorter, more concise syntax for writing function expressions. Introduced in ES6 (2015), arrow functions are now the most commonly written function syntax in modern JavaScript.

codejs
1// Regular function expression
2const add = function (a, b) {
3  return a + b;
4};
5
6// Arrow function — same behaviour, shorter syntax
7const add = (a, b) => {
8  return a + b;
9};