Implicit Binding

Describing Implicit Binding

  • Implicit binding occurs when dot notation is used to invoke a function
  • In implicit binding, whatever is to the left of the dot becomes the context for this in the function

Illustrating Implicit Binding

class Num {
  constructor(x, y) {
    this.x = x;
    this.y = y;
  }
}

let n = Num(10,20);
console.log(n.x);  // 10

References

Next

Explicit Binding