Stuck 12.Practice Makes Perfect


HERE IS MY CODE. KEEP GETTING "Have you defined object2 as an object?"

var object1 = new Object();
object1.key1 = value;
object1['key2'] = value;

var object2 = {
key1: value,
key2: value
var object2 = {};
object2.key1 = value;
object2['key2'] = value;

var object3 = new Object();
object3.key1 = value;
object3['key2'] = value;

Replace this line with your code.



You have defined it twice. This is likely the cause of the SCT error. Remove the second example of object2.


What lesson and unit are you on? because I don't think this is the Contact List unit. :smile:


Yeah - Don't know How Contact List got there. It is JavaScript 12.
Practice makes Perfect. I gave the code.
Nothing I try works. Any ideas. Why would Contact List have "12"?
Could the indexes have gotten mixed up?


I Clicked on menu at lower left and clicked on "13. Review" so got past the
bad one. I will see if I can get to the end.


"What lesson are you one?" translates to "Please post a link to the exercise." It's a simple matter of copying the URL from the location bar and pasting it in your post.


Okay for one my advice make your code as practical as possible in order to grasp it well for example,

var object1 = Object(); = "robinlrandall"

I just created an Object using the object constructor and assigned it a value name that's your username.


Sorry, hope this works


I got it to work Thanks. "value" was not defined.


This is correct:

as is this,

and this,

all with one exception. The undefined value variable. Put that in quotes and you have a solution. For practice, you could swap {} in for new Object() on the last one.

Remove this one...

as it overwrites your first one.


I never defined value.

At the top I should have said:
var value = "test"


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