To complete this assessment, create a Github Gist for each tasks below. Once completed, please email a link for each Gist to [email protected].
This assessment was designed to help evaluate your knowledge of the core Javascript language. Please do not use any libraries such as jQuery of Underscore.
-
Create a function called
fizzBuzz
that takes an integer (n). The function should loop over each number between 1 and n and prints "Fizz" if the number is divisible by 3, "Buzz" if the number is divisible by 5, "FizzBuzz" if the number is divisible by 3 and 5, and if the number is not divisible 3 or 5, it should print the number. -
Create a function called
flipCoin
that takes no parameters and randomly returns the string 'heads' or 'tails'. Create a second function calledflipCoinResults
that takes an integer n and runsflipCoin
n times.flipCoinResults
should return a string that represents the distribution of heads and tails for a gi