Skip to content

Instantly share code, notes, and snippets.

View GregSithole's full-sized avatar
💻
Training

Greg Sithole GregSithole

💻
Training
View GitHub Profile
@GregSithole
GregSithole / FizzBuzz.js
Last active August 25, 2023 11:57
Fizz Buzz Simple Challenge Javascript
/**
* Returns the Fizz Buzz value for a given number.
*
* @param {number} num - The input number.
* @returns {string|number} The Fizz Buzz value:
* - "Fizz" if the number is divisible by 3.
* - "Buzz" if the number is divisible by 5.
* - "FizzBuzz" if the number is divisible by both 3 and 5.
* - The input number if none of the above conditions are met.
*/