Here you can find the source of findById(id)
Array.prototype.findById = function(id) { for (var i = 0; i < this.length; i++) { if (this[i].id === id) return this[i]; }//from ww w . j a va 2 s.c o m return false; }
Array.prototype.findById = function (id) { for (var i = 0; i < this.length; i++) { if (this[i].id == id) { return i; return undefined; };