Comment

Comment by ReleaseCandidat

Ah, sorry, so you have to concat the arrays using `concat`.

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

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton