Q. What kind of scoping does JavaScript use?

  • (A) Literal
  • (B) Lexical
  • (C) Segmental
  • (D) Sequential
πŸ’¬ Discuss
βœ… Correct Answer: (B) Lexical
Explanation: Like most modern programming languages, JavaScript uses lexical scoping. This means that functions are executed using the variable scope that was in effect when they were defined, not the variable scope that is in effect when they are invoked.
Explanation by: Mr. Dubey
Like most modern programming languages, JavaScript uses lexical scoping. This means that functions are executed using the variable scope that was in effect when they were defined, not the variable scope that is in effect when they are invoked.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
153
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
81%
Success Rate