This question comes out of curiosity, but is there a limit to how many nested Objects a given Object can have (or similarly, since typeof [] === "object"
, how many Arrays can be nested in an Array) in JS?
I thought about creating an array that could have thousands of nested arrays, with thousands of numbers inside them as well. Setting aside possible best practice issues, I was wondering whether I could run into a cap at some point (that is, supposing it's not just a problem with, e.g., too much recursion or nested for-loops, or hardware limitations).
Related: how many nested object should i define in javascript?