javascript object max size limit at 10000 chars

后端 未结 2 1613
离开以前
离开以前 2021-01-15 10:24

When I run this code, the variable items only appends 9999 chars and rest is truncated. I got a few answers in the previous post but the problem still persists.



        
2条回答
  •  滥情空心
    2021-01-15 11:06

    You are alerting the value which means the array is converted to a String and then put in an alert box. Most probably, the String is cut off to some maximum length, otherwise it just won't fit on the screen or in the box for graphical reasons.

    When tried in-memory and only alerting the lengths, everything seems OK, also the toString() returns the correct length. I tried 4000 elements and analyzing the lengths: http://jsfiddle.net/LWD2h/1/.

提交回复
热议问题