Net-informations.com
SiteMap  | About    

What is Associative Array?

An associative array is simply a set of key value pairs. When we define an object, JavaScript automatically creates an array for this object. This allows us to refer to the data indices using strings.

which is the same as color.red .

Associative arrays as objects

The key idea is that every Javascript object is an associative array which is the most general sort of array you can invent sometimes this is called a hash or map structure or a dictionary object.

An associative array is declared or dynamically created. We can create it by assigning a literal to a variable.

Unlike simple arrays, we use curly braces instead of square brackets. Also, the content is accessed by keys, whatever the method used to declare the array.









net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.