Thuta Learning
AdvancedProgrammingbeginner

Arrow Functions

Relax. We'll talk through this in plain words — no textbook voice.

Arrow Functions (ES6) let you write function expressions with shorter, cleaner syntax. They also handle the this keyword differently.

javascript
// Traditional function expression
const add_old = function(a, b) {
  return a + b;
};

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

console.log(add_old(2, 3));
console.log(add_new(2, 3));
You should see
5 5
Arrow Functions | Thuta Learning