DEV Community

Discussion on: Unconditional Challenge: FizzBuzz without `if`

Collapse
 
dannyengelman profile image
Danny Engelman

A bit late to the party...

Array(100)
  .fill((x, div, label) => x % div ? "" : label) //store Function in every index
  .map((func, idx) =>
    func(++idx, 3, "Fizz") + func(idx, 5, "Buzz") || idx
  );
Enter fullscreen mode Exit fullscreen mode
Collapse
 
kallmanation profile image
Nathan Kallman

Welcome to the party!