10/33


#1

the instructions are:
Inspect the susan1 object carefully and note the use of object literal notation.

Use constructor notation to create susan2, which should have the same properties and values as susan1.

my code:
// Our bob object again, but made using a constructor this time
var bob = new Object();
bob.name = "Bob Smith";
bob.age = 30;
// Here is susan1, in literal notation
var susan1 = {
name: "Susan Jordan",
age: 24
};
// Make a new susan2 object, using a constructor instead
var susan2 = new Object();
susan.name = 'Susan Jordan';
susan.age = 24;

the error message I get is:
Oops, try again. Make sure susan1 and susan2 have the same name property

please help I don't know what ive done wrong


#2

var susan2 = new Object();
susan.name = 'Susan Jordan';
susan.age = 24;

Simply change susan.name and susan.age to:

susan2.name = 'Susan Jordan';
susan2.age = 24;

#3

it gives me an error message saying
Oops, try again. Make sure susan1 and susan2 have the same name property


#4

don't worry I understand now. thank you so much !!!!!! xox


#6

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