Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

People also ask

How many properties can a JS object have?

Summary. JavaScript objects have two types of properties: data properties and accessor properties.

How big can JavaScript objects be?

It looks that there is a limit at 16GB, but you can read some tests below or in @ssube's answer. But probably when your object/json is around 50 mb you'll encounter strange behaviour.

What are the properties of an object in JavaScript?

Object properties are defined as a simple association between name and value. All properties have a name and value is one of the attributes linked with the property, which defines the access granted to the property. Properties refer to the collection of values which are associated with the JavaScript object.

Do JavaScript objects have a length property?

The length property is used to get the number of keys present in the object. It gives the length of the object. the length of the 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.