Skip to content

Instantly share code, notes, and snippets.

@vjrngn
Created August 22, 2018 08:33
Show Gist options
  • Save vjrngn/d02fc197e84524ddc5124f5ceb136266 to your computer and use it in GitHub Desktop.
Save vjrngn/d02fc197e84524ddc5124f5ceb136266 to your computer and use it in GitHub Desktop.
  1. Define a variable name of type String using var or let
  2. Define a constant TIMEOUT with a value of 1000
  3. Create a user object with the following properties
    • firstName -> String
    • lastName -> String
    • age -> Number
    • fullName -> function that returns the join (concatenation) of firstName and lastName
  4. Create an array that has the names of your family members
  5. console.log every item in the family members array (from above) using a for loop
  6. Iterate over the family members array (from above) using the forEach method on array.
  7. Iterate over the family members array (from above) using the map method on array. The return value from map must be the capital cased version of each of the items in the array.
  8. Write a function isAllowedToEnter that takes as it’s only parameter, age, which is a Number. If the age provided is greater than or equal to 18, it must return true, otherwise it must return false.
  9. Write the basic structure of a HTML document.
  10. Create a square of size 50. This square must have a background colour of papayawhip with a border-radius of 5
  11. Extra credit
    1. Change the background colour of the square (from above) using jQuery, when the mouse enters the square.
    2. Create a button with text Click Me. Use plain JavaScript to console.log the value I have been clicked when the button is pressed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment