FrontendInterviews.dev

604. this Binding After Method Extraction

Easy•

Predict the output.

const obj = {
  value: 42,
  get() {
    return this.value
  }
}

const fn = obj.get
console.log(fn())

What does console.log(fn()) print?

Select an option and submit your answer.
Next Problem