75
rated 0 times
[
76]
[
1]
/ answers: 1 / hits: 70671
/ 15 Years ago, sun, may 17, 2009, 12:00:00
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 they both behave the same, and also typeof(myArray) == typeof(myObjects)
(both yield 'object').
Is there any difference between these variants?
More From » arrays