11.15 Multidimensional arrays



My code passes. My question is about my last array. I typed in Object as an element and received no error message. Why is this?

var obj1 = {
    age: 1, name: "obj"
var newArray = [[1,1], [2,2,2], [obj1, "object", Object]];


Why do you think it should give an error? :wink:


I assumed it would log as undefined to the console.


See this code more carefully:

var newArray = [[1,1], [2,2,2], [obj1, "object", Object]];

Notice that Object is highlighted differently as compared to obj1 (which is a variable). Now go ahead, open your browser console (hit F12 key), and type Object in it.

It isn't undefined :wink:


Ohhhhh, it's built into javascript?



Yes :slight_smile:



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