You can use the Array method filter, which returns a new array containing all the relevant elements. (there may be more than one matching element)
var results = items.filter(function(obj) { return obj.ITEM == 1; });
for (var i = 0; i < results.length; i++)
alert(results[i].AMOUNT);
Please note that IE6 (I'm not sure about newer versions) does not support the method filter. You can always define it yourself if it does not exist:
if (typeof Array.prototype.filter == 'undefined')
Array.prototype.filter = function(callback) {
var result = [];
for (var i = 0; i < this.length; i++)
if (callback(this[i]))
result.push(this[i]);
return result;
}
source
share