I need the index of the first value in the array, that matches a custom compare function.
The very nice underscorej has a \"find\" function that returns the
How about such find function ?
(function () { if (!Array.prototype._find) { Array.prototype._find = function (value) { var i = -1, j = this.length; if (typeof(value)=="function") for(; (++i < j) && !value(this[i]);); else for(; (++i < j) && !(this[i] === value);); return i!=j ? i : -1; } } }());