Array.prototype.findpath = function(item,path) { return this.find(function(f){return item==eval('f.'+path)}); }