Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

_baseIndexOf.js 659B

1234567891011121314151617181920
  1. var baseFindIndex = require('./_baseFindIndex'),
  2. baseIsNaN = require('./_baseIsNaN'),
  3. strictIndexOf = require('./_strictIndexOf');
  4. /**
  5. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  6. *
  7. * @private
  8. * @param {Array} array The array to inspect.
  9. * @param {*} value The value to search for.
  10. * @param {number} fromIndex The index to search from.
  11. * @returns {number} Returns the index of the matched value, else `-1`.
  12. */
  13. function baseIndexOf(array, value, fromIndex) {
  14. return value === value
  15. ? strictIndexOf(array, value, fromIndex)
  16. : baseFindIndex(array, baseIsNaN, fromIndex);
  17. }
  18. module.exports = baseIndexOf;