Help with Arrays and Objects


#1

Hi I needed help in this code I don't know what is wrong it keeps on saying unexpected identifier


var object1 = {
    name: 'Abhinav'
    age: 12
};
var bool1 = true;
myArray = [24, bool1, 'hi', object1];
console.log(myArray);


#2

in objects to separate you put a comma so you need to add a comma on this :arrow_down: line

Also missing var before myArray


#3

Thank you but when it got printed it looks like this
[ 24, true, 'hi', { name: 'Abhinav', age: 12 } ]
is it supposed to look like this ?


#4

yes :slight_smile:  


#5

Ok thank you very much