I've been trying to do the opposite of how you nest objects in Arrays. I'm using Colt Steele's course and he said it's possible to nest objects in arrays but he only showed the other way round.
Formatting requires 3 backticks (`) not apostrophe (') fyi.
And that code won't work as you are missing some commands, each item in an object must be separated by a comma, also there is no =, you use a colon (:)
What I've been trying to do is
...
var yes = {
Name: "Morris",
Age: 21
no = [22, 11, 1998]
};
I've been trying to do the opposite of how you nest objects in Arrays. I'm using Colt Steele's course and he said it's possible to nest objects in arrays but he only showed the other way round.
Forgive me I'm just learning
Formatting requires 3 backticks (`) not apostrophe (') fyi.
And that code won't work as you are missing some commands, each item in an object must be separated by a comma, also there is no =, you use a colon (:)
var yes = {
name: "Morris",
age: 21,
no: [22, 11, 1998]
};
Thanks. I can't believe the difference between = & : almost made me pull my entire hair out.
I saw mistake was declaring the array within the object with an equal sign (=) instead of a colon(:).
Thanks man