JavaScript对象中的属性数量是否有限制? [英] Are there limits to the number of properties in a JavaScript object?

查看:295
本文介绍了JavaScript对象中的属性数量是否有限制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个超过75000个属性的对象。对象的格式如下:

We have an object with more than 75000 properties. The format of the object is as following:

// The key starts with 3 letters and then is followed by 8 numbers
var bigArray = {'AAA########':123456789,
                'AAA########':123456790,
                'AAA########':123456791
               }; 

是否已知JavaScript对象的属性数量限制?从我的测试中,对象仍然可以在65500个元素上运行。

Is there a known limit of the quantity of properties for JavaScript objects? From my tests the object still works at 65500 elements.


  • 在Windows 7中,IE9脚本崩溃(错误-2147024882)。

  • Windows XP,IE8正常工作。

推荐答案

来自我们在这个问题上进行测试似乎IE9,Windows 7,将HTA脚本中的行数限制为65535.我没有找到任何关于此问题的来源,这只是我们测试的结果。

From our test on this issue it seems that IE9, Windows 7, limits the number of line in a HTA script to 65535. I did not find any source on the issue, it is just the results of our tests.

这篇关于JavaScript对象中的属性数量是否有限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆