0Pricing
JavaScript Academy · Lesson

this Basics; call/apply/bind (intro)

Understand what this refers to in functions and methods; learn arrow this, and taste call/apply/bind.

Intro to this

Goal: See what this refers to in different calls, learn arrow this, and try call/apply/bind in tiny steps.

  • Method vs plain call
  • Arrow this
  • call/apply/bind
this Basics; call/apply/bind (intro) — illustration 1

Method call this

In a method call, this points to the object before the dot.

// Method call: this is the object before the dot
const user = {
  name: "Ayla",
  say() {
    console.log("I am", this.name);
  }
};

user.say();
this Basics; call/apply/bind (intro) — illustration 2

All lessons in this course

  1. Declarations vs Expressions, Arrow Basics
  2. Parameters, Defaults, Rest, and Returns
  3. this Basics; call/apply/bind (intro)
← Back to JavaScript Academy