Skip to content

Instantly share code, notes, and snippets.

@CLofton
Last active September 25, 2016 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save CLofton/501c78a912b73da20290 to your computer and use it in GitHub Desktop.
Save CLofton/501c78a912b73da20290 to your computer and use it in GitHub Desktop.
//Intermediate Midterm
//Please fork this gist. Complete it, and remember to save often! All characters that are not JS need to be commented with "//".
// 1. How do you make comments and why do you make them?
// 2. Set 3 variables with different data types and console.log them.
// 3. What are the five primitive data types you have been using. Provide an example of each.
// 4. Create a function that console.logs the remainder of 2 numbers.
// 5. Write an example of an if statement.
// 6. Explain what “scope” means and why it’s important.
// 7. Create an array and console.log the 3rd item in the array.
// 8. Create an object and demonstrate how to access a value in it.
// 9. Demonstrate how to add a key/value pair to your object.
// 10. Create a for loop that prints out all the multiples of 3 between 1 and 100.
// 11. Create a while loop that prints out all the multiples of 7 between 1 and 100 in reverse order.
// 12. Create an object called “bob”. Assign the object “bob” the following properties:
//name: "Bob Smith",
//age: 30
//Then print out bob’s full name by accessing the properties within the object.
//Answer:
//13. Create a method called “aging” that adds 20 years to bob’s age. Then print out bob's new age.
//Answer:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment