16 Help requested!



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

var myObject = {
  name: 'Eduardo',
  type: 'Most excellent',
  // Add your code here!
  interests: 'Sports'

why is 'sports' not a value? (I also tried it with "sports")
thanks for the help!


It is a value, but it's a string value, not an array :slight_smile:

MDN reference - array


what's the differance then? I'm really getting confused. does it need []?



The difference is that interests is a plural, you can have many interests, right? And you can represent them using an array:

['Sports', 'Programming', 'Progressive rock']


oh okay thanks! :slight_smile:


but then I'll ahve to define them first no? At least that's whta's poping up as error


Can you post your code? After correction?

There was an unclosed string in the example posted by me, I corrected it. Sorry about that.


var myObject = {
name: 'Eduardo',
type: 'Most excellent',
// Add your code here!
interests: [Sports, programming, trap, Marshmello]

Oops, try again. Your code doesn't look quite right. Use the existing object keys/values as a guide! And check the error message for more information: ReferenceError: Sports is not defined


Pretty good attempt, but this [Sports, programming, trap, Marshmello] is array of variables.

Sports -> variable with name Sports.
'Sports' -> a string, text value.

You need to create array of strings, so you need to add parentheses around every element of array.


I love you! Thanks for explaining! :smile:


Haha :slight_smile: You're very welcome :panda_face:


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