16/17 Editing an existing object


#1

I don't understand what it says....


#2

There is an already created object in the editor, you just need to add a property whose name is "interests" and it must contain an array which is made with square brackets.


#3

All you got to do is create an array called myInterests and list things that you like.

var myInterests = ["optionOne", "optionTwo", "optionTree", "optionFour"];

Now write myInterests into myObject.

interests : myInterests

Then console.log() it!


#4

var arra = [ 2,32,44];

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


#5

Thanks Everyone :-)+1:


#6

no prob blog hehehheheehehehe get it if not........... Sigh corny welcome :yum:


#7

Thank you! I understood what I had to do, but I wasn't clear on exactly HOW they wanted me to write it. I added it inside the object, outside of it, etc. and it was valid, just not what the checker wanted. I didn't know we had to create the array first and just reference it. Cheers!


#8

Thanks. stuck in this one, i didn't know that i had to create an array.. for interests key.


#9

thx @scriptdolphin & @may101

I got this completely wrong haha.

*...poor lad tis a shame...they say e's a bit dim...

*still at least 'e tries........n... tries...n.... well. yeah, e' just ..... tries....**

i can see now why they named 'im tim! ...


#10

I made it in another way and it is also works:

var myObject = {
name: 'Eduardo',
type: 'Most excellent',
// Add your code here!
interests: ['cars', 'horses', 'yachts']
};


#11

Thanks a lot :slight_smile:


#12

Try this, You put your array into Object

`//Declare Array for the key
var WebProgramming = [["C++","Php"],["Java Script"]];

//Declare An Object
var myObject = {
name: 'Eduardo',
type: 'Most excellent',
// Add your code here!
interests: WebProgramming,
};

`


#13

hi ,why interests: WebProgramming,
instead of interests: "WebProgramming"?
thanks