15 Why is this working?


var newArray = [[{}, 2],["cat", true, 12]];

When asked to add an object to an array, I have found that by simply adding { }, curly braces to the array....it allows me to proceed. Why is that? Thanks in advance.


Maybe because it works as an object in an array? It may be something like booleans, where "true" and "false" work without quotations. Have you tried putting colons or something else?

JS may just be able to hold it as an object.


Yes actually, when it passed the first time. I tried entering, a boolean, number, and string in its place and I was getting the message asking me to add an object. When I place the { } back in, it worked.