indexOf.js 468 B

123456789101112
  1. var sortedIndex = require('./sortedIndex.js');
  2. var findIndex = require('./findIndex.js');
  3. var _createIndexFinder = require('./_createIndexFinder.js');
  4. // Return the position of the first occurrence of an item in an array,
  5. // or -1 if the item is not included in the array.
  6. // If the array is large and already in sort order, pass `true`
  7. // for **isSorted** to use binary search.
  8. var indexOf = _createIndexFinder(1, findIndex, sortedIndex);
  9. module.exports = indexOf;