lib/sortedArray.js
function indexOf(element, fromIndex) {
    /* jshint validthis:true */
    var arr = toArray(this),
        index;

    if (fromIndex) {
        arr = arr.slice(fromIndex);
    }

    index = binarySearch(arr, element, this.comparator);

    if (index < 0) {
        return -1;
    } else {
        return index;
    }
}
function indexOf(element, fromIndex) {
    /* jshint validthis:true */
    var arr = toArray(this),
        index;

    if (fromIndex) {
        arr = arr.slice(fromIndex);
    }

    index = binarySearch(arr, element, this.comparator);

    if (index < 0) {
        return -1;
    } else {
        return index;
    }
}
function indexOf ( element , fromIndex ) { /* jshint validthis:true */ var arr = toArray ( this ) , index ; if ( fromIndex ) { arr = arr . slice ( fromIndex ) ; } index = binarySearch ( arr , element , this . comparator ) ; if ( index < 0 ) { return - 1 ; } else { return index ; } }
Works like Array.prototype.indexOf but uses a faster binary search.

Same signature as Array.prototype.indexOf
@see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
Works like Array . prototype . indexOf but uses a faster binary search .