1.

What type of scope is present in JavaScript?(a) Lexical(b) Literal(c) Both Lexical and Literal(d) LocalI had been asked this question during an interview for a job.This key question is from JavaScript Benchmarking and Logging with perfLogger topic in chapter Parsing, Benchmarking and Logging of JavaScript

Answer»

Right ANSWER is (a) Lexical

To explain: Lexical SCOPING (sometimes known as static scoping) is a convention used with many programming languages that sets the SCOPE (RANGE of functionality) of a variable so that it may only be called (referenced) from within the block of code in which it is defined.



Discussion

No Comment Found

Related InterviewSolutions