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.4 KiB

id, title, challengeType, videoUrl, localeTitle
id title challengeType videoUrl localeTitle
56bbb991ad1ed5201cd392d3 Delete Properties from a JavaScript Object 1 从JavaScript对象中删除属性

Description

我们还可以删除对象中的属性,如下所示: delete ourDog.bark;

Instructions

myDog删除"tails"属性。您可以使用点或括号表示法。

Tests

tests:
  - text: 从<code>myDog</code>删除属性<code>&quot;tails&quot;</code> 。
    testString: assert(typeof myDog === "object" && myDog.tails === undefined);
  - text: 不要修改<code>myDog</code>设置
    testString: 'assert(code.match(/"tails": 1/g).length > 1);'

Challenge Seed

// Example
var ourDog = {
  "name": "Camper",
  "legs": 4,
  "tails": 1,
  "friends": ["everything!"],
  "bark": "bow-wow"
};

delete ourDog.bark;

// Setup
var myDog = {
  "name": "Happy Coder",
  "legs": 4,
  "tails": 1,
  "friends": ["freeCodeCamp Campers"],
  "bark": "woof"
};

// Only change code below this line.

After Test

console.info('after the test');

Solution

// solution required