🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Scope, Closures, Hoisting and this: all 15 questions

Quiz: Scope, Closures, Hoisting and this · Question 9 of 15

Why does an arrow function used inside a method see the method's this?

Why does an arrow function used inside a method see the method's this?

  1. A.Arrow functions always point to window
  2. B.Arrow functions have no own this, so they use the this of the surrounding code
  3. C.Arrow functions copy the object
  4. D.Because of hoisting
Answer & explanation

Correct answer: Arrow functions have no own this, so they use the this of the surrounding code

Arrow functions borrow this lexically, which is handy for callbacks inside methods.

Can you get the rest right without peeking?

Take the timed Quiz: Scope, Closures, Hoisting and this quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →