Okay, well, my next solution is probably not what you were expecting. It builds on the idea that a boolean can be used as a number. I think it meets the hardcore requirements.
constisFizz=n=>n%3===0constisBuzz=n=>n%5===0constisNeither=n=>!isFizz(n)&&!isBuzz(n)// the magic:constoptional=(f,x)=>Array(Number(f(x))).fill(x)constfizzbuzz=n=>{constfizz=optional(isFizz,n).map(_=>'Fizz')constbuzz=optional(isBuzz,n).map(_=>'Buzz')constnum=optional(isNeither,n).map(String)return`${fizz.join('')}${buzz.join('')}${num.join('')}`}
Okay, well, my next solution is probably not what you were expecting. It builds on the idea that a boolean can be used as a number. I think it meets the hardcore requirements.
Very nice! I think you have met the hardcore requirements.
And I think slightly less code than my functional solution will be, well done!