Here are some more (I omitted the console logging though, these are just the basic solving function):
const fizzbuzz = x=>[x,f='fizz',b='buzz',f+b][!(x%3)|!(x%5)<<1]
and:
const fizzBuzz = x=>({1:x,6:f="fizz",10:b="buzz",0:f+b}[x**4%15])
Yeah, that's awesome
But unreadable and not easy to extend
let FB = Array(100) .fill((x, div, label) => x % div ? "" : label) .map((func, idx) => func(++idx, 3, "Fizz") + func(idx, 5, "Buzz") || idx );
`
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Here are some more (I omitted the console logging though, these are just the basic solving function):
and:
Yeah, that's awesome
But unreadable and not easy to extend
`