ES6 Arrow Functions

const add = (a, b) => a + b;

console.log(add(5, 3)); // 8

Explanation:

  • Arrow functions are a shorter way to write functions.
  • add(5,3) returns 8.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *