chrispiccaro18 / fizz-buzz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fizz-buzz

TDD a pure function that takes a integer number and returns a string of all numbers up to and including the supplied number, except:

  1. Numbers evenly divisable by 3 should be replace with Fizz
  2. Numbers evenly divisable by 5 should be replace with Bizz
  3. Numbers evenly divisable by 3 and 5 should be replace with FizzBuzz

For example, calling the function with 16 would return:

1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, 16

Techniques and Concepts Used in this Lab

  1. Tool: Use 3rd-party testing library
  2. Variables: Declaring and assign const variable
  3. Variables: Assign variable from property of global object
  4. Testing: TDD a pure function
  5. Functions: Calling a function
  6. Functions: Using an anonymous function as a function argument
  7. Functions: Define function parameter
  8. Testing: Test assertions with assert.equal

Stretch Techniques You May Have Encountered

  1. ESModules: export default and import default
  2. Variables: Declare let variable with sensible default
  3. Variables: Reassign let variable in a loop
  4. Strings: String concatenation with + and +=

About


Languages

Language:JavaScript 84.5%Language:HTML 15.5%