Objects

Let's compare some variables!
We're now completing our work in Submlime and the console.

This object has been added to the page:

    var student = {
        name: "John Doe",
        age: 20,
        subject: "Philosophy"
    };
  1. Print out the student object by typing student in the console.
  2. Print out just the name variable of the student object.
    • Hint: student.name;
  3. Print out just the age variable of the student object.
  4. Print out just the subject variable of the student object.
  5. Open the 005-objects.html file in Sublime Text. Create a new object with the name car.
    • Hint: Look for the comment "WRITE YOUR OBJECT HERE" to find out where you should add your code.
  6. Following the syntax of the student object, create the following object variables with a value of your liking:
    • brand
    • year
    • color
  7. Save the 005-objects.html file and refresh this page in your browser.
  8. Print out your object in the console.
  9. Print out each of your object variables in the console.
    • Hint: car.brand;