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

428
Visualizações
Is there a maximum depth level for nested objects in Javascript?

Javascript has no problems with nesting an object within itself, i.e. if you have an object A, you can pass it as a property on object A:

const nested = {};
nested.name = "hi";
nested.child = nested;

console.log(nested, nested.child, nested.child.child, "... and so on");

If you run this in the browser console, you can actually keep expanding the child property until... infinity?

Is there a limit to how deep objects an be nested, and what is it?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

No, there is no limit and you can freely nest further. But, if you keep consolelogging nested objects in nested objects and so on, the program would slow down due to limited memory.

about 4 years ago · Juan Pablo Isaza Relatório

0

There's no limit in the Javascript specification.

If you wanted to find a particular limit in a particular JS engine, you'd have to code a test and see if you could find a limit and running into a limit would probably not be related at all to nesting, but just to number of objects and memory used by them.

about 4 years ago · Juan Pablo Isaza Relatório
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