The Code

      
        //Get the input values.
        function GetValues() {
          //Get the user inputs from the page and parse them into numbers
          let swiftValue = parseInt(document.getElementById('swiftValue').value);
          let buzzValue = parseInt(document.getElementById('buzzValue').value);
          let stopValue = parseInt(document.getElementById('stopValue').value);
        
        //Check to make sure only numbers were entered
        if (Number.isInteger(swiftValue) && Number.isInteger(buzzValue) && Number.isInteger(stopValue)) {
          if(stopValue>5000){
            //If the stop value is larger than 5000 to protect the page from crashing 
            Swal.fire({
              icon: 'error',
              title: 'Oops!',
              text: 'Stop Value should be less than 5000'
            });
            }
            else if(swiftValue==0||buzzValue==0){
            //Make sure the user didnt enter a 0 value for swift or buzz
            Swal.fire({
              icon: 'error',
              title: 'Oops!',
              text: 'Swift and Buzz values cannot be 0'
            });
            }
            else{
               //If all are numbers Generate FizzBuzz then display it.
            let possibleValues = GenerateFizzBuzzDry(swiftValue, buzzValue, stopValue);
            DisplayFizzBuzz(possibleValues);
            }
        }
        else 
            {
              //If they are not, tell the user
              Swal.fire({
                icon: 'error',
                title: 'Oops!',
                text: 'Only integers are allowed for SwiftBuzz'
              });
            }
        }
        
        //Generate the FizzBuzz.
        function GenerateFizzBuzz(swiftValue, buzzValue, stopValue) {
        
          let swiftBuzzArray = [];
        
          for (let i = 0; i <= stopValue; i++) {
            if (i % (swiftValue * buzzValue) == 0) {
              //Put Fizz Buzz Result Here
              swiftBuzzArray.push('SwiftBuzz');
            }
            else if (i % swiftValue == 0) {
              //Put Swift Result Here
              swiftBuzzArray.push('Swift');
            }
            else if (i % buzzValue == 0) {
              //Put Buzz Result Here
              swiftBuzzArray.push('Buzz');
            }
            else {
              //Put Plain Number Here
              swiftBuzzArray.push(i);
            }
        
        
          }
        
          return swiftBuzzArray
        }
        
        //Display the result to the screen.
        function DisplayFizzBuzz(swiftBuzzArray) {
          let tableBody = document.getElementById('results');
          let tableHTML = "";
        
          for (let i = 1; i < swiftBuzzArray.length; i++) {
            let value = swiftBuzzArray[i]
            let className = '';
        
            if (value == 'Swift') {
              className = 'swift';
            }
            else if (value == 'Buzz') {
              className = 'buzz';
            }
            else if (value == 'SwiftBuzz') {
              className = 'swiftBuzz';
            }
            else{
              className='';
            }
        
            //Force Table to only be 5 columns wide
            if (i-1% 5 == 0) {
              tableHTML += ''
            }
        
            //Generate the td html for each result and append it to the existing tableHTML
            let tableData = `${value}`
            tableHTML += tableData;
        
            /*Check if the next index is divisible by 5 and if so 
           close our tr tag on the current row*/
            if ((i) % 5 == 0) {
              tableHTML += '';
            }
          }
          tableBody.innerHTML = tableHTML;
          recursiveSwiftBuzzArray = [];
          counter = 0;
        }
        
      
    

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.