Javascript Array findInput(fn)
/**//from ww w .j a va 2 s. co m * Function finds value for array. */ Array.prototype.findInput = function(fn) { return this.filter(val => fn(val))[0]; };