12. Practice makes perfect, syntax error


#1

Trying to understand the 3 types covered in the lesson. I error - Syntax error : unexpected identifier. Any help is greatly appreciated.

var object1 = {
name : "John Michael"
age : 32
gender : "Male"
};

var object2 = {};
object2.name = "Joanna Qusinberry";
object2.age = 33;
object2.gender = "Female";
console.log(object2.name);
console.log(object2.age);
console.log(object2.gender);

var object3 = new Object();
object3['name'] = "Daphne Jean";
object3['age'] = 1;
object3['gender'] = "Female";
console.log(object3['name']);
console.log(object3['age']);
console.log(object3['gender']);


#2

The error lies here

var object1 = {
    name : "John Michael"
    age : 32
    gender : "Male"
};

you should have a comma after each property except the last like this

var object1 = {
    name : "John Michael",
    age : 32,
    gender : "Male"
};

#3

thanks a TON!! Couldn't pick that out...


#4

Hey! I tried using the same code as the one posted here, but I still get error. Can somebody see where my fault is?

var object1 = {
name: "Frode",
age: 19,
gender: "Male"
};

var object2 = {};
object2.name = "Frode;
object2.age = 19;
object2.gender = "Male";
console.log(object2.name);
console.log(object2.age);
console.log(object2.gender);

var object3 = new Object();
object3['name'] = "Frode";
object3['age'] = 19;
object3['gender'] = "Male";
console.log(object3['name']);
console.log(object3['age']);
console.log(object3['gender']);


#5

in object2 name is "frode; (missing "Frode")


#6

It says

Oops, try again.
Did you make an object called object1?

var myObj = new Object();
myObj.object1 = "1";
myObj.object2 = "2";
myObj.object3 = "3";


#7

use this but change the name and age to your name and age

var object1 = {
name: "Brandon",
age: 14,
gender: "Male"
};

var object2 = {};
object2.name = "Brandon";
object2.age = 14;
object2.gender = "Male";
console.log(object2.name);
console.log(object2.age);
console.log(object2.gender);

var object3 = new Object();
object3['name'] = "Brandon";
object3['age'] = 14;
object3['gender'] = "Male";
console.log(object3['name']);
console.log(object3['age']);
console.log(object3['gender']);


#8

I'm wondering where are making mistake? can anybody help me whit this. thanks
var object1 = {;
name: "Martin",
age: 28,
gender: "male"
};
var object2 = {};
object2.name = "Martin";
object2.age = 28;
object2.gender = "male";
console.log(object2.name);
console.log(object2.age);
console.log(object2.gender);

            var object3 = new Object();
            object3['name'] = "Martin";
            object3['age'] = 28;
            object3['gender'] = "male";
            console.log(object3['name']);
            console.log(object3['age']);
            console.log(object3['gender']);

#9

No need i found the mistake:
var object1 = {; it suppose to be like this one " var object1 = { "