What Am I Doing Wrong?


#1


Arrays and Objects in JS
"Practice makes perfect" 12/17

Syntax Error: Unexpected token .


var object1 = new Object();
    object1.time = 2;
    object1.date = 8/11/16;

var object2 = {
    object2.speak: 'English';
}

var object3 = {};
    object3.monitor = 'SAMSUNG';
    object3['pc'] = 'HP';


#2

the object declaration you use here is wrong:

var object2 = {
    object2.speak: 'English';
}

since speak is defined inside the curly brackets of object2 you don't need it:

var object2 = {
    speak: 'English';
}

and this declaration also uses , instead of semi-colons


#3

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