The Code
The code is structured in three functions
getValues()
This function is what allows the user to interact with the app. The function waits and listen for the user to click the "Run" button. Once the button is pressed, it takes in the information provided by the user on the App page, and first converts the information to numbers.
After the verification is completed, if the information does not pass the check, or the count value provided is higher than the posted limit, it will prompt the user to enter whole numbers only or a count value less than the posted maximum. If the information does pass the check, it stores it for use in other parts of the program to use.
generateFizzBuzz(end, fizz, buzz)
This function uses the information provided from the getValues()
function and generates a range of numbers between the starting and ending value. Then it checks to see if the numbers in the generated range are divisible by the "Fizz" and "Buzz" values provided by the user.
displayFizzBuzz(arr)
This function displays the numbers on the screen and provides "Fizz", "Buzz", and "FizzBuzz" class names to be able to style their own individual backgrounds with CSS to easily distinguish between them.