🎙 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 8 of 15

For a normal (non-arrow) function, what decides the value of this?

For a normal (non-arrow) function, what decides the value of this?

  1. A.Where the function is written in the file
  2. B.How the function is called
  3. C.The name of the function
  4. D.The number of arguments
Answer & explanation

Correct answer: How the function is called

obj.method() gives obj; a bare call gives undefined in strict mode; bind, call and new set it explicitly.

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 →