Arrow Functions in JavaScript

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

One of the most powerful features of arrow functions is their concise syntax. In many situations, arrow functions allow developers to write functions using fewer lines of code.

When a function contains only one expression, JavaScript allows the function to return a value automatically without using the return keyword. This makes the code shorter and easier to read.

Basic Concise Arrow Function

When an arrow function contains a single statement, the curly braces and return keyword can be omitted.

javascript const square = (num) => num * num; console.log(square(5));
Output

25

In this example, the function automatically returns the result of num * num.

Arrow Function with Single Parameter

If a function has only one parameter, the parentheses around the parameter can also be omitted.

javascript const greet = name => "Hello " + name; console.log(greet("Student"));
Output

Hello Student

Using Arrow Functions with Arrays

Arrow functions are commonly used with array methods such as map(), filter(), and forEach().

javascript let numbers = [1,2,3,4]; let doubled = numbers.map(num => num * 2); console.log(doubled);
Output

[2, 4, 6, 8]

Benefits of Concise Arrow Functions

  • Shorter and cleaner code
  • Easy to read and understand
  • Perfect for callbacks and array operations
  • Commonly used in modern JavaScript frameworks

Conclusion

Concise arrow functions make JavaScript development faster and more efficient. By reducing unnecessary syntax, developers can write cleaner code while maintaining functionality.

Arrow functions are widely used in modern JavaScript programming and are considered an essential skill for developers.

In the next tutorial, you will learn about Scope in JavaScript, which explains how variables behave inside functions and blocks of code.

Get Newsletter

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