问题
I'm aware that the ECMA script spec says that an object can have infinite children however I also understand many ECMA script implementations do not conform to this. I was wondering if node has a limit on the amount of children an object can have?
Thanks, Ed.
回答1:
Yes it can but until heap out of memory.
var a = {};
var i = 0;
while(true){
a[i] = null;
i++;
}
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
So it depends on your memory size.
来源:https://stackoverflow.com/questions/54220438/maximum-object-children-on-node-js