Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

419
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!