JavaScript Tutorial

Arrow Functions

Concise function syntax with lexical this binding.

const add = (a, b) => a + b;
const obj = {
  bindThis() {
    setTimeout(() => console.log(this)); // obj
  }
};