* fix: Chinese test suite Add localeTiltes, descriptions, and adjust test text and testStrings to get the automated test suite working. * fix: ran script, updated testStrings and solutions
1.5 KiB
1.5 KiB
id, title, challengeType, videoUrl, localeTitle
id | title | challengeType | videoUrl | localeTitle |
---|---|---|---|---|
587d7dac367417b2b2512b74 | Use Dot Notation to Access the Properties of an Object | 1 | 使用点表示法访问对象的属性 |
Description
properties
的object
,现在您将看到如何访问这些properties
的值。这是一个例子: 让duck = {点符号用于
名称:“Aflac”,
numLegs:2
};
的console.log(duck.name);
//这会将“Aflac”打印到控制台
object
名称duck
,后跟property
name
,以访问“Aflac”的值。 Instructions
dog
对象的两个properties
打印到控制台。 Tests
tests:
- text: 您应该使用<code>console.log</code>来打印<code>dog</code>对象的<code>name</code>属性的值。
testString: assert(/console.log\(.*dog\.name.*\)/g.test(code));
- text: 您应该使用<code>console.log</code>来打印<code>dog</code>对象的<code>numLegs</code>属性的值。
testString: assert(/console.log\(.*dog\.numLegs.*\)/g.test(code));
Challenge Seed
let dog = {
name: "Spot",
numLegs: 4
};
// Add your code below this line
Solution
// solution required