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

toArray.js 380B

123456789101112131415
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var reduce_1 = require("./reduce");
  4. function toArrayReducer(arr, item, index) {
  5. if (index === 0) {
  6. return [item];
  7. }
  8. arr.push(item);
  9. return arr;
  10. }
  11. function toArray() {
  12. return reduce_1.reduce(toArrayReducer, []);
  13. }
  14. exports.toArray = toArray;
  15. //# sourceMappingURL=toArray.js.map