The Code
The basic three function app, where we get some user input, generate the FizzBuzz then display the results
GetValues()
This function we get the users input values and check to make sure that they are actually numbers. If they are we pass them into our generate function, if not we popup a warning window informing the user that they entered an invalid input.
GenerateFizzBuzz()
To generate our values, we loop through each number from 0 to the users input stop value. To check if the value is devisible by the swift and buzz values we first multiply them together and use the modulus operator to see if the value we are testing goes into this calculation evenly. If there is no remainder we push a value of "SwiftBuzz" into our results array. If the value being checked is not divisible by both we take the modulus of the value to test and the user inputs for both swift and buzz and push the appropriate input into the results array. If the test value isnt divisibe by any of those inputs, we push the number itself into the results array.
DisplayFizzBuzz()
After iterating through all of the possibe values, we grab the results element from the page, and build a 5 column table to display the FizzBuzz results.