The lexical scooping in JavaScript is based on which of the following?

The lexical scooping in JavaScript is based on which of the following?
A. Segments
B. Blocks
C. Functions
D. Entire code
 
Answer: c
Explanation: 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. JavaScript has lexical scoping based on functions but not blocks.
 

Tìm kiếm

Back
Top