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

191
Visualizações
Why does Firefox debugger stop twice at the end of some functions in Javascript?

I'm using the Firefox debugging extension in VS Code and have set a breakpoint at the last line (line 13) of the code below so that it stops before executing outer();. Then I step with F11 through the JS-Code and wonder why I have to press F11 twice at line 8 and line 11?!

function outer() {
    function inner() {
        function innermost() {
            console.log("in innermost")
        }
        console.log("in inner");
        innermost();
    } //line 8
    console.log("in outer");
    inner();
} //line 11

outer(); //line 13

The script-tag is placed on an empty static html page:

<body>
    <script src="main.js"></script>
</body>

Btw, is there a possibility to stop execution (at the breakpoint in line 13) already when the page is loading for the very first time so I don't have to reload the page in browser with F5 in order to test? How can i debug the very first loading of the page?

EDIT: The same does not happen with the Edge browser and the already integrated debugger (which doesn't need an extension for VS Code). With Edge i don't have to press F11 twice in lines 8 and 11 and i am also able to debug the first page load!

May anyone knows what's the reason for Firefox behaving like that?

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