top | item 20075958 (no title) londt8 | 6 years ago Technically there is no iteration in filter/map/reduce at all. discuss order hn newest Stratoscope|6 years ago That's incorrect. All of those functions are implemented using iteration.Consider this excerpt from the .map() polyfill on MDN:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... // 7. Let k be 0 k = 0; // 8. Repeat, while k < len while (k < len) { // [loop body omitted] // d. Increase k by 1. k++; }
Stratoscope|6 years ago That's incorrect. All of those functions are implemented using iteration.Consider this excerpt from the .map() polyfill on MDN:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... // 7. Let k be 0 k = 0; // 8. Repeat, while k < len while (k < len) { // [loop body omitted] // d. Increase k by 1. k++; }
Stratoscope|6 years ago
Consider this excerpt from the .map() polyfill on MDN:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...