Skip to content

QuizNot attempted

new vs bind

const B = A.bind(obj); const x = new B(); What is this inside A?
1–4 to choose, Enter to submit
Show answer & explanation

Correct answer:

  • A brand new object (instance of A); the bound obj is ignored
  • new has the highest precedence: constructing a bound function ignores the bound this and creates a fresh object linked to A.prototype (bound arguments still apply).
  • Precedence: new > explicit (bind/call/apply) > method call > plain call.
  • Not obj: bind loses to new.
  • Not undefined: that is a strict-mode plain call.
  • Not 'throws': bound regular functions are constructible (bound arrows aren't, because arrows never are).