Not accepting Array Value


#1

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


Add a key called interests to myObject. Give this key an array value (the array can contain whatever you like).
It is not accepting my code.


Replace this line with your code. 

var myArray = [true, false];
var myObject = {
  name: 'Eduardo',
  type: 'Most excellent',
  // Add your code here!
  interests: myArray[0]
};


#2

problem.
interests: myArray[0]

myArray[0] is a single value (true) not an array

You have to add an array as a value of key interests
hint**
array of numbers..

[1,2,3,4,5] ?


#3

Thanks. Changing to
interests: myArray

fixed the issue


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.