DEV Community

Discussion on: Daily Challenge #40 - Counting Sheep

Collapse
 
andymardell profile image
Andy Mardell • Edited

This is sweet. Something similar but with more Array and less map:

const f = i => Array.from(Array(i), (_, i) => `${i + 1} sheep... `).join``

or

const f = i => Array.from({ length: i }, (_, i) => `${i + 1} sheep... `).join``