Some improvement to my earlier version.
A) better (arguably, because way more cognitive load than the very simple one above)
const fizzBuzz = (until, current = 0, fizzbuzz = ["", "Fizz", "Buzz"]) => { const fizzybuzzy = () => fizzbuzz[!(current % 3) * 1] + fizzbuzz[!(current % 5) * 2] || current; return (current + 1 <= until) && (console.log(fizzybuzzy()), fizzBuzz(until, current + 1)); } fizzBuzz(100);
B) above one as 1 liner b/c hello perl
const devBuzz = (function i(u, c= 0, m=["", "dev", ".to"]) {(c+1<=u) && (console.log(m[!(c % 3)*1] + m[!(c%5)*2] || c), i(u,c+1));}); devBuzz(20);
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.
Some improvement to my earlier version.
A) better (arguably, because way more cognitive load than the very simple one above)
B) above one as 1 liner b/c hello perl