Skip to content

Instantly share code, notes, and snippets.

@kevincolten
Forked from CLofton/2016_JS_Midterm.js
Created June 23, 2016 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevincolten/70dc7e246bd3a8f5e62d4f7cb2dcf53e to your computer and use it in GitHub Desktop.
Save kevincolten/70dc7e246bd3a8f5e62d4f7cb2dcf53e to your computer and use it in GitHub Desktop.
//Intermediate Midterm
//Please fork this gist. Complete it, and remember to save often!
// 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