Hacker News new | ask | show | jobs
by graftak 1162 days ago
A little bit better: Array.from({ length: 100 }, () => ...)
1 comments

Indeed, much cleaner to do `Array.from({length: 100}, (_,i) => fizzbuzz(i));`
While we're cleaning it up:

   fizzbuzz = i => (i % 3 ? "" : "Fizz") + (i % 5 ? "" : "Buzz") || i
   Array.from({length: 100}, (_,i) => console.log(fizzbuzz(i+1)))