src/lib/collections/list.js
function (startIndexOrMatch, countOrMatch, match) {
        var len = this.length,
            startIndex = isNumber(startIndexOrMatch) ? startIndexOrMatch : 0,
            count = isNumber(countOrMatch) ? countOrMatch : len - startIndex;

        match = isFunction(startIndexOrMatch) ? startIndexOrMatch : (isFunction(countOrMatch) ? countOrMatch : match);

        assertType(match, Function);
        validateListIndex(this, startIndex);

        while (count-- > 0 && startIndex < len) {
            if (match(this[startIndex]) === true) {
                return startIndex;
            }

            startIndex++;
        }

        return -1;
    }
function (startIndexOrMatch, countOrMatch, match) {
        var len = this.length,
            startIndex = isNumber(startIndexOrMatch) ? startIndexOrMatch : 0,
            count = isNumber(countOrMatch) ? countOrMatch : len - startIndex;

        match = isFunction(startIndexOrMatch) ? startIndexOrMatch : (isFunction(countOrMatch) ? countOrMatch : match);

        assertType(match, Function);
        validateListIndex(this, startIndex);

        while (count-- > 0 && startIndex < len) {
            if (match(this[startIndex]) === true) {
                return startIndex;
            }

            startIndex++;
        }

        return -1;
    }
function ( startIndexOrMatch , countOrMatch , match ) { var len = this . length , startIndex = isNumber ( startIndexOrMatch ) ? startIndexOrMatch : 0 , count = isNumber ( countOrMatch ) ? countOrMatch : len - startIndex ; match = isFunction ( startIndexOrMatch ) ? startIndexOrMatch : ( isFunction ( countOrMatch ) ? countOrMatch : match ) ; assertType ( match , Function ) ; validateListIndex ( this , startIndex ) ; while ( count -- > 0 && startIndex < len ) { if ( match ( this [ startIndex ] ) === true ) { return startIndex ; } startIndex ++ ; } return - 1 ; }
Searches for an element that matches the conditions defined by the specified predicate,
and returns the zero-based index of the first occurrence within the range of elements
in the List that starts at the specified index and contains the specified number of elements.
@param {Number|Function} startIndexOrMatch The zero-based starting index of the search or the predicate function, eg. function(item)
@param {Number|Function=} countOrMatch The number of elements in the section to search or the predicate function, eg. function(item)
@param {Function=} match The predicate function that defines the conditions of the elements to search for, eg. function(item)
@returns {Number}
Searches for an element that matches the conditions defined by the specified predicate and returns the zero - based index of the first occurrence within the range of elements in the List that starts at the specified index and contains the specified number of elements .