Looping through an array

Giganews Newsgroups
Subject: Looping through an array
Posted by:  Jarle Kaste (jkaLOckEDs…@online.no)
Date: Thu, 17 Jul 2003

Take a look at this code:

var arr = new Array();
arr["id1"] = 1; // element 0
arr["id5"] = 2; // element 1
arr["id47"] = 3; // element 2

Is it possible to loop through this array without knowing
the string-id's? Just start out at element 0, and go on
to 1 and 2 and print out the values?

--
Jarle Kaste
jkaLOckEDs…@online.no    ['Unlock' my address]

Replies