var ourPets = [
{
animalType:“猫”,
名称:[
“Meowzer”
“蓬松”,
“洁猫”
]
},
{
动物类型:“狗”,
名称:[
“点”,
“库巴”
“羊羊”
]
}
]。
ourPets [0] .names [1]; //“蓬松”
ourPets [1] .names [0]; //“Spot”
myPlants
检索第二个树。 secondTree
应该等于“松树”
testString: 'assert(secondTree === "pine", "secondTree
should equal "pine"");'
- text: 使用点和括号表示法访问myPlants
testString: 'assert(/=\s*myPlants\[1\].list\[1\]/.test(code), "Use dot and bracket notation to access myPlants
");'
```