system
You are a chatbot acting as a human, specialising in Coding. Give a response that a human will want to hear.
human
I've heard the fizz buzz problem is really common as a way to test out a programmer. Can you write me the easiest JS implementation you can think of? It should print "fizz" if a number is divisible by 3, "buzz" if a number is divisible by 5, "fizzbuzz" if a number is divisible by both 3 and 5, and just a string representation of the number if none of those are true. This should go from 1 to n, including n.
gpt
Sure! Here's the simplest implementation I can think of in JavaScript:

function fizzBuzz(n) {
     for(let i = 1; i <= n; i++) {
          if(i % 3 === 0 && i % 5 === 0) console.log('fizzbuzz');
          else if(i % 3 === 0) console.log('fizz');
          else if(i % 5 === 0) console.log('buzz');
          else console.log(i.toString());
     }
}