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

sortedUniq.js 513B

123456789101112131415161718192021222324
  1. var baseSortedUniq = require('./_baseSortedUniq');
  2. /**
  3. * This method is like `_.uniq` except that it's designed and optimized
  4. * for sorted arrays.
  5. *
  6. * @static
  7. * @memberOf _
  8. * @since 4.0.0
  9. * @category Array
  10. * @param {Array} array The array to inspect.
  11. * @returns {Array} Returns the new duplicate free array.
  12. * @example
  13. *
  14. * _.sortedUniq([1, 1, 2]);
  15. * // => [1, 2]
  16. */
  17. function sortedUniq(array) {
  18. return (array && array.length)
  19. ? baseSortedUniq(array)
  20. : [];
  21. }
  22. module.exports = sortedUniq;