Comment

Comment by ReleaseCandidat

Yes, but you could also use `fold`^H^H^H^H`reduce`.

[1, 2, 3, 4, 5].reduce((acc, n) => n % 2 === 1 ? acc.push(2*n) : acc, [])

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton