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

_strictIndexOf.js 600B

1234567891011121314151617181920212223
  1. /**
  2. * A specialized version of `_.indexOf` which performs strict equality
  3. * comparisons of values, i.e. `===`.
  4. *
  5. * @private
  6. * @param {Array} array The array to inspect.
  7. * @param {*} value The value to search for.
  8. * @param {number} fromIndex The index to search from.
  9. * @returns {number} Returns the index of the matched value, else `-1`.
  10. */
  11. function strictIndexOf(array, value, fromIndex) {
  12. var index = fromIndex - 1,
  13. length = array.length;
  14. while (++index < length) {
  15. if (array[index] === value) {
  16. return index;
  17. }
  18. }
  19. return -1;
  20. }
  21. module.exports = strictIndexOf;