Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

_arrayIncludes.js 526B

1234567891011121314151617
  1. var baseIndexOf = require('./_baseIndexOf');
  2. /**
  3. * A specialized version of `_.includes` for arrays without support for
  4. * specifying an index to search from.
  5. *
  6. * @private
  7. * @param {Array} [array] The array to inspect.
  8. * @param {*} target The value to search for.
  9. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  10. */
  11. function arrayIncludes(array, value) {
  12. var length = array == null ? 0 : array.length;
  13. return !!length && baseIndexOf(array, value, 0) > -1;
  14. }
  15. module.exports = arrayIncludes;