// 2021-09-28
for(i=1;i<101;i++)console.log([,,,"Fizz",,"Buzz"].map((v,n)=>i%n?'':v).join('')||i)
// 2022-07-18
for(i=0;++i<101;)console.log([,,,"Fizz",,"Buzz"].map((v,n)=>i%n?'':v).join('')||i)
how did i never think about optimizing the damn for loop lmao
(if youre OOTL what code golf/fizzbuzz is click read more)
Code golf:
Code golf is a type of recreational computer programming competition in which participants strive to achieve the shortest possible source code that solves a certain problem.
FizzBuzz:
(also available as a Tom Scott video)
Fizz buzz (often spelled FizzBuzz in this context) has been used as an interview screening device for computer programmers.
The player designated to go first says the number "1", and the players then count upwards in turn. However, any number divisible by three is replaced by the word fizz and any number divisible by five by the word buzz. Numbers divisible by 15 become fizz buzz. For example: 1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, Fizz Buzz, 16, 17, Fizz, 19, Buzz, Fizz, 22, 23, Fizz, Buzz, 26, Fizz, 28, 29, Fizz Buzz, 31, 32, Fizz, 34, Buzz, Fizz, ...
Writing a program to output the first 100 FizzBuzz numbers is a relatively trivial problem requiring little more than a loop and conditional statements. However, its value in coding interviews is to analyze fundamental coding habits that may be indicative of overall coding ingenuity.