This content originally appeared on 2ality – JavaScript and more and was authored by Dr. Axel Rauschmayer
Iteration is a standard that connects operations with data containers: Each operation that follows this standard, can be applied to each data container that implements this standard.
In this blog post:
- We first explore three questions:
- How does JavaScript’s iteration work?
- What are its quirks?
- What do helper functions for iteration look like? Examples include iteration versions of the Array methods
.map()
,.filter()
, and.forEach()
.
- Next, we examine the pros and cons of several approaches for implementing helper functions: As methods of data containers? As functions? Etc. Two of these approaches are supported by concrete proposals.
- The post concludes by explaining additional benefits of iteration and iteration-based helpers.
This content originally appeared on 2ality – JavaScript and more and was authored by Dr. Axel Rauschmayer
Dr. Axel Rauschmayer | Sciencx (2021-08-09T00:00:00+00:00) JavaScript needs more helper functions for iteration (map, filter, etc.) – where should we put them?. Retrieved from https://www.scien.cx/2021/08/09/javascript-needs-more-helper-functions-for-iteration-map-filter-etc-where-should-we-put-them/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.