Arrow Functions in JavaScript

Javascript 8 min min read Updated: Mar 09, 2026 Intermediate
Arrow Functions in JavaScript
Intermediate Topic 3 of 15

Arrow functions were introduced in JavaScript ES6 (ECMAScript 2015). They provide a shorter and more modern way to write functions compared to traditional function expressions.

Arrow functions are widely used in modern JavaScript applications because they simplify function syntax and make code easier to read. They are especially common in frameworks such as React, Node.js, and modern frontend development.

What is an Arrow Function?

An arrow function is a compact way to write a function using the => arrow operator. Instead of using the function keyword, developers can define functions using this modern syntax.

javascript const greet = () => { console.log("Hello, Student"); }; greet();
Output

Hello, Student

In this example, the arrow function is stored in a variable named greet. When the function is called, it prints a message in the console.

Arrow Function with Parameters

Arrow functions can also accept parameters just like regular functions.

javascript const welcome = (name) => { console.log("Welcome " + name); }; welcome("Rahul");
Output

Welcome Rahul

Arrow Function with Multiple Parameters

When a function needs multiple inputs, the parameters are written inside parentheses.

javascript const add = (a, b) => { return a + b; }; console.log(add(5, 3));
Output

8

Why Arrow Functions are Important

Arrow functions make JavaScript code cleaner and more concise. They are commonly used in modern applications, especially when working with arrays, callbacks, and asynchronous code.

Because of their shorter syntax, developers prefer arrow functions when writing modern JavaScript programs.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators