Arrays and Objects


var myObject = {
name : 'Eduardo',
type: 'Most excellent',
interests: ['myInterests'],
var myInterests = ["optionOne", "optionTwo", "optionTree", "optionFour"];

I just want to know the code to make the console print the name, Most excellent, and myIntrerests.

or i can't i don't know sorry noob!


If we examine this closely we see that is not a reference as intended. It is a single string primitive as the lone element of an array. What happens if you write it like so?

    interests: myInterests

Once the fix is done, we can test it by logging the object:

// { name: 'Eduardo', type: 'Most excellent', interests: undefined }

Notice what the value for interests is? undefined. Why is that, do you think?


i see thank you so much :grin: