1/15 An Objective Review


My code:

var james = {
// add properties to this object!
job: "programmer",
married: false

function Person(job, married) {
this.job = job;
this.married = married;

// create a "gabby" object using the Person constructor!
var gabby = new Object();
gabby.job = "student";
gabby.married = true;

The result: "Oops, try again. Make sure you created gabby using the Person constructor!"

What's wrong here? Thx.


you should create a Person here, not an object


Got it, thanks!
That works:

var gabby = new Person("student", true);


This is the constructor:

Use it like this:

var gabby = new Person("student", true);

to create object of type Person.