dev2 – review 08-11 Problem Set

  1. Random Color – Create a function randomColor() when called returns a random RGB color value like rgb(173, 65, 203).
  2. Game – Create three functions startGame()endGame(), and checkGame(). Each function returns the boolean value of gameOver and should affect gameOver as the function name suggests.
  3. Range Array – Create a function rangeArray(start, end)which takes two numbers as arguments. The function returns an array containing all the numbers from the start up to and including the end. For example: rangeArray(3, 9) returns [3,4,5,6,8,9].
  4. Only Numbers – Create a function onlyNums(arr) which takes an array as an argument. The function returns an array that has removed any values except numbers. For example: onlyNums(["fun", 23, 45, undefined, "a", 4]) returns [23, 45, 4].

Leave a comment

Your email address will not be published. Required fields are marked *