2.5 KiB
2.5 KiB
id | title | challengeType | guideUrl | videoUrl | localeTitle |
---|---|---|---|---|---|
56533eb9ac21ba0edf2244cd | Accessing Nested Arrays | 1 | https://arabic.freecodecamp.org/guide/certificates/access-array-data-with-indexes | الوصول إلى صفائف متداخلة |
Description
var ourPets = [
{
animalType: "قطة" ،
الأسماء: [
"Meowzer"
"رقيق"،
"كيت كات"
]
}،
{
animalType: "dog" ،
الأسماء: [
"بقعة"،
"العربة"،
"فرانكي"
]
}
].
ourPets [0] .names [1]؛ // "رقيق"
ourPets [1] .names [0]؛ // "سبوت"
Instructions
myPlants
المتغير باستخدام myPlants
نقطة الكائن myPlants
مجموعة الصفيف. Tests
tests:
- text: <code>secondTree</code> ينبغي أن يساوي "الصنوبر"
testString: 'assert(secondTree === "pine", "<code>secondTree</code> should equal "pine"");'
- text: استخدم نقطة <code>myPlants</code> قوس للوصول إلى <code>myPlants</code>
testString: 'assert(/=\s*myPlants\[1\].list\[1\]/.test(code), "Use dot and bracket notation to access <code>myPlants</code>");'
Challenge Seed
// 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
After Test
console.info('after the test');
Solution
// solution required