Search code examples
javascriptobjectproperties

Are there limits to the number of properties in a JavaScript object?


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
               }; 

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

  • In Windows 7, IE9 the script crashes (error -2147024882).
  • Windows XP, IE8 works fine.

Solution

  • 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.