Array.prototype.getObjectByName = function(name) {
var i, len = this.length, self;
for(i = 0; i < len; i++) {
self = this[i];
if(typeof self == 'object' && self.name == name) return self;
}
};
var prices = [{name: 'table', price: 200}];
alert( prices.getObjectByName('table').price );