Questenaتدريب يوضح لك ما ينبغي مراجعته لاحقًا
السؤال 94

Which statements describe lexical name lookup in JavaScript? Select all that apply.

  1. A function searches the local variables of whichever function called it
  2. The current lexical environment is checked before an enclosing oneالإجابة الصحيحة
  3. Property prototypes determine which lexical binding wins
  4. Lookup can continue through successively enclosing lexical environmentsالإجابة الصحيحة

الشرح

Name resolution starts in the current lexical environment and proceeds outward through the environments that enclose it. A caller's unrelated local scope is not inserted into that chain, so dynamic lookup based on who made the call is false.

تابع هذا الاختبار

بدء التدريب
السؤال 94: Which statements describe lexical name lookup in… · JavaScript Fundamentals · Questena