Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • which is the same as myObject.a = 'b';, since you can use dot notation as long as the property name is a valid JS variable name, so you could not use dot notation for myObject['no dot!'] = 'b'. Commented Jul 31, 2011 at 16:57
  • 8
    Nonsense. Of course javascript has associative arrays. For all intents and purposes thats what a Javascript Object IS. How it works under the hood is neither here nor there. Commented Aug 20, 2013 at 14:33
  • 2
    @RichardRiley - A JavaScript object is an unordered collection of properties. The concept of order is possibly the key point of arrays. Commented Aug 20, 2013 at 18:53
  • This is not 100% correctly, and the two are not the same. You cannot iterate, in order, on an Object since it does not work like an Array, which was designed to be iterate-able. The question is how to create such an array in a non-repeatable manner. Commented Aug 3, 2015 at 15:30