Javascript Array setItem(key, value, new_value)
Array.prototype.setItem = function(key, value, new_value) { for (var i=0; i < this.length; i++) { if (this[i][key] === value) { this[i] = new_value;/*w w w . ja v a2 s. co m*/ return; } } }