Questenaتمرینی که نشان می‌دهد بعد چه چیزی را مرور کنید
سؤال 84

A factory call creates a local count binding and returns an inner function that reads count. The factory call has finished. Why can the inner function still read count?

  1. All local bindings automatically become global
  2. The factory call remains permanently active on the call stack
  3. The caller recreates count before every inner call
  4. The inner function retains its creation scope through a closureپاسخ درست

توضیح

The returned inner function closes over the lexical environment in which it was created, retaining access to count after the factory call ends. The caller's current local variables do not replace that environment, because this access is lexical rather than caller-based.

ادامهٔ این آزمون

شروع تمرین
سؤال 84: A factory call creates a local count binding and returns an… · JavaScript Fundamentals · Questena