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 i;/* ww w . ja v a2s.co m*/ } } return undefined; };
Array.prototype.findById = function(id) { for (var i = 0; i < this.length; i++) { if (this[i].id === id) return this[i]; return false;