I am going to create a 1-D JSON array, I just want to be sure about it's scalability. Is there any upper limit on number of key:Value pairs that could be present in a JSON?
JSON is just a textual representation of JS objects so the only limit is the memory storage capacity that holds it.
For actual Javascript Arrays it depends on the implementation by the software, but per the spec:
http://www.ecma-international.org/ecma-262/5.1/#sec-15.4
Every Array object has a length property whose value is always a nonnegative integer less than 2^32
So the limit is (2^32)-1 or 4294967295 if adhering to the spec.
try {
new Array(4294967295);
} catch(e){
alert("Should be fine and not see this");
}
try {
new Array(4294967296);
} catch(e){
alert(e.name);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With