Lexical environment and function scope

前端 未结 3 1171
梦谈多话
梦谈多话 2020-12-04 06:43

Is lexical environment and scope in javascript one and the same thing?

3条回答
  •  不知归路
    2020-12-04 07:35

    Lexical Environment is the environment of the function where it is written. That is, the static order/place where it is situated, regardless from where it is called from.

    Scope of a variable/function is basically the locations from where a variable is visible/accessible.

    Execution context is the status of the execution stack at any point during runtime. That is the current execution context.

提交回复
热议问题