Objects II ex. 1/30


#1

Can someone please tell me what am I doing wrong here?

this is my code:
var james = {
// add properties to this object!
james.job = "programmer";
james.married = false;

};

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

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

this is the link:
https://www.codecademy.com/en/courses/objects-ii/0/1?curriculum_id=506324b3a7dffd00020bf661#

this is the error:
SyntaxError: Unexpected token .


#2

Literal notation creates a single object. Literal notation uses curly brackets { } and the object's default properties are defined within the brackets using property:value notation.so it should be like

var obj = {
property: "value",
otherProp: 42
};

so in your case

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

and remove these line

this.job(); //TypeError: this.job is not a function
this.married(); //this.married is not a function

#3

whats wrong in this ? rcodeman thanx in advance

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

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

// create a "gabby" object using the Person constructor!
var gabby = Person("student",true);