JavaScript starter pack for the 'FizzBuzz' assignment
- Open the file called
fizzbuzz.js
- Write a program that loops through numbers 1 to 100, and outputs 'Fizz', 'Buzz', 'FizzBuzz', or the number
- For each number in the loop:
- If the number is a multiple of 3, output 'Fizz'
- If the number is a multiple of 5, output 'Buzz'
- If the number is a multiple of both 3 and 5, output 'FizzBuzz'
- If the number is not a multiple of either 3 or 5, output the number
- Output using the
output()
function. e.g.output('Fizz')
The first 10 lines of the output for your code should be as followed:
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
If you want to test the code for yourself before submitting, you can open the vizTest.html file in your browser.
Once you have completed the task, simply push your changes back to the repository for this assignment. After the submission deadline, only the latest push will be considered. DO NOT EDIT FILES IN THE '_campus' FOLDER! Doing so may lead to a fail.