Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 666 Bytes

README.md

File metadata and controls

12 lines (10 loc) · 666 Bytes

fizzBuzz_JS

Exercise Write a fizzBuzz function in JavaScript. As a reminder, this function should take a number as argument, and then either:

Return "Fizz" if this number is divisible by 3. Return "Buzz" if this number is divisible by 5. Return "FizzBuzz" if this number is divisible by both 5 and 3. Otherwise, Return the number itself.

  • Initialise a new project directory with a package.json file and install Jest.
  • In a file fizzbuzz.test.js, Write one test case for each acceptance criteria above, - using one it block for each, and matchers to test the function's return value.
  • Write the fizzBuzz function in the file fizzbuzz.js to the four tests pass.