Kristofer Koishigawa b3213fc892 fix(i18n): chinese test suite (#38220)
* 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
2020-03-03 18:49:47 +05:30

1.5 KiB
Raw Blame History

id, title, challengeType, videoUrl, localeTitle
id title challengeType videoUrl localeTitle
587d7dac367417b2b2512b74 Use Dot Notation to Access the Properties of an Object 1 使用点表示法访问对象的属性

Description

最后一个挑战创建了一个具有各种propertiesobject ,现在您将看到如何访问这些properties的值。这是一个例子:
让duck = {
名称“Aflac”
numLegs2
};
的console.logduck.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