Feels notable that Iterator helpers have become Baseline Newly available. The gist is that you can map
and filter
on stuff that was annoying or impossible to before. I’ll copy Jeremy Wagner’s example:
const posts = document.querySelectorAll("ul#specific-list > li")
.values()
.filter(item => item.textContent.includes("kiwi"));
// For-of loops can only be used on iterables, which `posts` is!
for (const post of posts) {
console.log(post.textContent);
}
Code language: JavaScript (javascript)