Why can I add named properties to an array as if it were an object?

The following two different code snippets seem equivalent to me: var myArray = Array(); myArray[‘A’] = “Athens”; myArray[‘B’] = “Berlin”; and var myObject = {‘A’: ‘Athens’, ‘B’:’Berlin’}; because …