+2 votes
in Programming Languages & Algorithms by
lexical environment in Javascript definition

1 Answer

+1 vote
by (31.1k points)
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.

Related questions

Welcome to CPEN Talk
Solution-oriented students of computer engineering on one platform to get you that


Scientists have estimated that the energy given off during the Big Bang is roughly equal to 1CNRhK (Chuck Norris Roundhouse Kick).