Stuck on "Lesson 14"


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-9Sgpi/3/1?curriculum_id=506324b3a7dffd00020bf661


I really don't understand what the instructions are telling me to do and am stuck. I don't understand what the hints are hinting at either. I copied the hints code and used it in mine and it works but what it logs to the console isn't really what the instructions wanted in each parameter.


var bool = true;

myArray = [bool];

var myObj = {
    type: 'fancy',
    disposition: 'sunny'
};

myArray = [myObj]

var myArray = [15, bool, "Arthur" , myObj]


#2

you are over complicating, this is what you need:

var myObj = {
    type: 'fancy',
    disposition: 'sunny'
};
var myArray = [15, bool, "Arthur" , myObj]

the only thing that is wrong, is that Boolean values are either true or false, so replace bool with true or false, that is it


#3

What i mean is that it isn't displaying the number, it isn't saying true and it certainly isn't saying Arthur to the console


#4

you don't log anything to the console? That is just codecademy's console logging something, if you want myArray to be logged you should do this:

console.log(myArray)

#5

Sorry if I've confused you but what I'm trying to say is that when i click submit it displays the array in the box on the right hand side. But what it shows is this

[{"type":"fancy","disposition":"sunny"}]

It doesn't show the number the boolean or the string i've set.


#6

because the codecademy console displays this one:

myArray = [myObj]

the values are there, if you add:

console.log(myArray)

at the very end, you will see the other array


#7

Ok that cleared up a lot of questions. Thanks!