Logs 'Fizz' for multiples of three, 'Buzz', for multiples of 5, and 'Fizz Buzz' for multiples of 3 & 5 I'm new to coding and have been directed here from Stack Overflow. As I'm new to coding, I'm not entirely sure if my program works completely, but I think it does. I'm looking for suggestions on how to improve my code, particularly the format, as well as the code itself please.
Rather than output FizzBuzz for the first 100 numbers, i.e., 1 - 100, I wanted to write a program that could output FizzBuzz for any positive whole number range.
const fizzBuzz = (num) =&gt; {
  let fizzBuzzNumbers = [];

  const populateArray = num =&gt; {
    for (let i = 1; i &lt; num + 1; i++) {
      fizzBuzzNumbers.push(i);
    }
  };

  populateArray(num)

  for (let i = 0; i &lt; fizzBuzzNumbers.length; i++) {
    if (fizzBuzzNumbers[i] % 3 === 0 &amp;&amp; fizzBuzzNumbers[i] % 5 === 0) {
      console.log('FizzBuzz');
    } else if (fizzBuzzNumbers[i] % 3 === 0 &amp;&amp; fizzBuzzNumbers[i] % 5 !== 0) {
      console.log('Fizz');
    } else if (fizzBuzzNumbers[i] % 3 !== 0 &amp;&amp; fizzBuzzNumbers[i] % 5 === 0) {
      console.log('Buzz');
    } else {
      console.log(fizzBuzzNumbers[i]);
    }
  }
}; 

Any feedback or suggestions will be greatly appreciated.
A short review;

You don't need the array, you could just use i
Part of the challenge is to realize that you only have to check for 3 and 5
i is a good short variable, I would go for num -&gt; n or even count
I only use fat arrow syntax =&gt; for inline functions
Function names ideally follow &lt;verb&gt;Thing syntax so fizzBuzz -&gt; logFizzBuzz

This is my counter proposal;


function logFizzBuzz(count){

  for (let i = 1; i &lt;= count; i++) {
    let out = '';
    if (i % 3 === 0){
      out += 'Fizz';
    }
    if (i % 5 === 0){
      out += 'Buzz';
    }
    console.log(out || i);
  }
}; 


logFizzBuzz(45);