Here you can find the source of findByName(name)
/**//from w w w . j a va 2 s. c om * Array Utilities */ Array.prototype.findByName = function(name) { name = String(name); return this.find(i => i.name === name); };
Array.prototype.findByName = function(name) { for(var i = 0; i< this.length; ++i) { if( this[i].name == name) return this[i]; };