Tell us what’s happening:
I have just started learning javascript and in a earlier challenge(link of the challenge is"https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/build-javascript-objects")I learnt that javascript objects start with curly braces"{ }" but in this challenge javascript object starts with big bracket “[ ]”. I have checked by the (typeof) feature and console is showing that “myPlants” is an object.Can anyone help me regarding this bracket problem?
Your code so far
// Setup
var myPlants = [
{
type: "flowers",
list: [
"rose",
"tulip",
"dandelion"
]
},
{
type: "trees",
list: [
"fir",
"pine",
"birch"
]
}
];
// Only change code below this line
var secondTree = ""; // Change this line
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36
.
Challenge: Accessing Nested Arrays
Link to the challenge: