By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,399 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,399 IT Pros & Developers. It's quick & easy.

netscape & associative arrays

P: n/a
g
Hi,

I would like to step through all the key-value pairs in an associative
array. I'm trying:
for (var i=0 in hashOfItems) { // go through all keys in the hash
hashOfItems
// do sth
}
which works fine in Internet Explorer but does not seem to be
recognised in Netscape Navigator. What is the right way to write this?

Thanks,
Gina
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


g wrote:
I would like to step through all the key-value pairs in an associative
array. I'm trying:
for (var i=0 in hashOfItems) { // go through all keys in the hash
hashOfItems
// do sth
}


Why do you want to set i = 0?? Simply do

for (var key in object) {

}
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.