Help I don't know what I am doing wrong!


#1

This is my code
var myObject = {
name: 'Eduardo',
type: 'Most excellent',
interests: "javaScripts"
};
var newArray = [1, 2, 22, true, false, myObject]

please help the error msg says
Oops, try again. Did you give your interests key an array value?
Thx


#2

@absolutebossskill,

Your error is on this line:


interests: "javaScripts"

It expects that variable to be an "array", so just make that an array and you should be good to go!


#3

thx that was it!:sweat_smile:


#4

A post was split to a new topic: Object in an Array


#5

how do u make it an array