indexOf.js 439 B

1234567891011
  1. define(['./sortedIndex', './findIndex', './_createIndexFinder'], function (sortedIndex, findIndex, _createIndexFinder) {
  2. // Return the position of the first occurrence of an item in an array,
  3. // or -1 if the item is not included in the array.
  4. // If the array is large and already in sort order, pass `true`
  5. // for **isSorted** to use binary search.
  6. var indexOf = _createIndexFinder(1, findIndex, sortedIndex);
  7. return indexOf;
  8. });