What\'s the best way to store a key=>value array in javascript, and how can that be looped through?
key=>value
The key of each element should be a tag, such as
If I understood you correctly:
var hash = {}; hash['bob'] = 123; hash['joe'] = 456; var sum = 0; for (var name in hash) { sum += hash[name]; } alert(sum); // 579