JavaScript ES6+ Free Crash Course 2025 – Key ES6+ Features – Arrow Functions

This JavaScript crash course covers key features introduced in ECMAScript 2015 (ES6) and later versions. It’s designed for developers with prior programming experience, focusing on practical applications and clean code practices in 2025. In every post we will cover one topic and gradually it will take you to finish the course without breaking a sweat. In today’s lesson we will discuss arrow functions.

Key ES6+ Features

First of all we are going to cover the main featueres of this course. We will begin with arrow functions.

Arrow Functions

Arrow functions provide a concise syntax for writing function expressions. Here is one example of that we have given below:


// Traditional function function add(a, b) {
return a + b;
}

// Arrow function
const add = (a, b) => a + b;

// With single parameter, parentheses are optional const square = x => x * x;

// With no parameters
const sayHello = () => console.log('Hello!');

// Multi-line arrow function const multiply = (a, b) => {
let result = a * b; return result;
};

 

  • Use arrow functions for short, simple operations.
  • Be cautious with this binding in arrow functions.

Common Pitfalls:

  • Arrow functions don’t have their own this context. They can’t be used as constructors.
  • They can’t be used as constructors.

In the coming posts we will will cover more features and functions more quickly.