Stop turning everything into arrays (and do less work instead)

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

JavaScript iterator helpers provide a lazy alternative to eager array methods, processing data only when needed. Instead of creating multiple intermediate arrays with `.map().filter().slice()`, iterator helpers like `.values().filter().map().take()` stop early and avoid unnecessary work. This is particularly useful for large datasets, virtualized lists, infinite scrolling, and streaming APIs. While arrays remain better for small datasets and random access patterns, iterator helpers reduce memory allocation and computation by matching how UIs actually consume data. Supported in modern browsers (Chrome 122+, Firefox 131+, Safari 18.4+) and Node.js 22+.

4m read timeFrom allthingssmitty.com
Post cover image
Table of contents
Arrays everywhere (and way more work than necessary)So, what are iterator helpers?Lazy by defaultWhat this buys you in real appsIterator helpers vs. array methodsWhen not to use iterator helpersGotchas you should know aboutCan I use this today?Doing less work on purpose

Sort: