Hire Our Expert Programmer & Technical Writer To Do Your Capstone Project
+2 votes
in Programming Languages & Algorithms by
lexical environment in Javascript definition

1 Answer

+1 vote
by (user.guest)
Best answer

Lexical Environment is an abstract container in the Javascript engine that holds the identifier-variable mapping. Consider the example below:

function getWebsiteName(){

var website = 'CPEN Talk';




When you define a variable as done in the function above, the internal Javascript engine maps the name of the variable (website) to the variable (reference to the actual object).

For every new function call, a new function execution context is created and added to the execution context stack with its corresponding lexical environment.

Welcome to CPENTalk.com

Disclaimer: Every user is solely responsible for anything that he/she posts or uploads on CPENTalk.