QuestenaPractice that shows what to review next
Question 114

A program evaluates the identifier total, but no accessible lexical environment contains that name. Which error type results?

  1. TypeError
  2. ReferenceErrorCorrect answer
  3. SyntaxError
  4. No error; unresolved names evaluate to undefined

Explanation

Normal identifier resolution searches the accessible lexical environments, and failure to resolve the name causes an error of the ReferenceError type. This is not a TypeError because no value was obtained for an operation; the lookup itself failed.

Continue with this test

Start practice
Question 114: A program evaluates the identifier total, but no accessible… · JavaScript Fundamentals · Questena