DEV Community

loading...

Discussion on: What’s your alternative solution? Challenge #2

Collapse
vfabricio profile image
Vilson Fabricio Juliatto

A solution with a more functional flavor:

const range = (start, end) => Array(end - start).fill(null).map((_ , i) => i + start)
range(1, 100).filter(x => x % 2 === 1)