Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
One more time about Lexical Environment vs Execution Context in JS

I've already read :

What is the difference and relationship between execution context and lexical environment?

Lexical environment and function scope

https://262.ecma-international.org/6.0/#sec-lexical-environments

https://262.ecma-international.org/6.0/#sec-execution-contexts and more...

Just want to clarify one final time for myself. What is the actual difference between Lexical Environment vs Execution Context?

Am I right that they're absolutely the same thing, but Execution Context is actually one of Lexical Environments in our code that is currently on the top of our callstack??

So let's say we have

1 function one() {
2  return
3 }
4
5 function two() {
6  one()
7 }
8
9 two()

First we have out global context in the stack, it's currently our Execution Context. Browser starts running our code, goes down to line 9 and put function two() on the top of the call stack. So now our Execution Context is the Lexical Environment of this function. Is that correct or am I missing smth? Thanks for help!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda