ReferenceError?


#1

var bool1 = true;
var myObj = {
age: 14,
gender: 'boy'
};
var myobj2 = new Object();
myobj.age = 14;
myobj["Gender"] = "boy";

var myArray = [2,bool1,"Hello", myObj];

I don't understand, why it says myObj reference error.


#2

Hi
there is a small typo at lines 7 and 8. I think that you should replace myobj.age by myobj2.age and myobj["Gender"] by myobj2["Gender"]


#3

Oh, I didn't catch that. Thanks.