15/17 newObject is not defined

var pizza=newObject();

var newArray= [[7,8,8,9,0],[“y”,“e”], [pizza]]

the error I am getting is ReferenceError: newObject is not defined

I checked the syntax on my object that I constructed outside of the array and it looks ok to me but isn’t… anybody see the problem? is it the way I’ve written my object?

1 Like

i just re-wrote my object like this:
var pizza={};
pizza.size= “Large”;

and it worked… I still want to know why the other way didn’t work though

I believe ‘newObject’ needs to be separated by a space, ‘new Object’. You are not creating a name ‘newObject’ but you are creating a ‘new’ ‘Object’.


got it, that makes sense… im going to try that on the exercise i’m on right now (the contact list)