Utilizor
Contact Us

Arrow Functions

Short syntax for writing functions.

Arrow Functions

Arrow functions allow a short syntax for writing function expressions.

You don't need the function keyword, the return keyword, and the curly brackets.

const x = (x, y) => x * y;

Arrow functions do not have their own this. They are not well suited for defining object methods.

Example

const hello = () => {
  return "Hello World!";
}