Editing an existing object


#1

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

It says "Oops, try again. Did you give your interests key an array value?"


var anArray = ["hello",4, false];
var myObject = {
  name: 'Eduardo',
  type: 'Most excellent',
  interests: anArray[1]// Add your code here!
  
};


#3

look at this code:

var anArray = ["hello",4, false];
var myObject = {
  name: 'Eduardo',
  type: 'Most excellent',
  interests: anArray[1]// Add your code here!
  
};
console.log(myObject['interests'])

as you can see, interests is an integer (from an array), but interests should be an array


#4

Thank you stetim94. I was thinking that is wanted a value of an array, not a value that is an array.


#5

A post was split to a new topic: Editing an existing object


#6

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