QuestenaՎարժանք, որը ցույց է տալիս՝ ինչ կրկնել հաջորդիվ
Հարց 87

A var declaration appears inside an if block that is itself inside a function. Which statements are true? Select all that apply.

  1. The binding belongs to the containing function scopeՃիշտ պատասխան
  2. The binding is accessible directly outside the containing function
  3. Code later in the same function can use it after the assignment executesՃիշտ պատասխան
  4. The binding ceases to exist as soon as the if block ends

Բացատրություն

Within a function, var belongs to that function's scope rather than to the inner if block. Once normal execution has performed its assignment, code later in the same function can use the binding, but code outside the function cannot access it directly.

Շարունակեք այս թեստով

Սկսել վարժանքը
Հարց 87: A var declaration appears inside an if block that is itself… · JavaScript Fundamentals · Questena