An Objective Review


#1

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 Person("student", true);

SyntaxError: Invalid shorthand property initializer

I really don't understand what's wrong! Please help me!


#2

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

};

use : instead of =

The values are written as name : value pairs (name and value separated by a colon).


#3

Thank you so much! Generally I not noticed! Thank you!!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.