* 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
2.6 KiB
2.6 KiB
id, title, isRequired, challengeType, videoUrl, localeTitle
id | title | isRequired | challengeType | videoUrl | localeTitle |
---|---|---|---|---|---|
a39963a4c10bc8b4d4f06d7e | Seek and Destroy | true | 5 | 寻找和摧毁 |
Description
你必须使用
arguments
对象。如果卡住,请记得使用Read-Search-Ask 。编写自己的代码。 Instructions
Tests
tests:
- text: '<code>destroyer([1, 2, 3, 1, 2, 3], 2, 3)</code>应该返回<code>[1, 1]</code> 。'
testString: assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1]);
- text: '<code>destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3)</code>应该返回<code>[1, 5, 1]</code> 。'
testString: assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1]);
- text: '<code>destroyer([3, 5, 1, 2, 2], 2, 3, 5)</code>应该返回<code>[1]</code> 。'
testString: assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1]);
- text: '<code>destroyer([2, 3, 2, 3], 2, 3)</code>应该返回<code>[]</code> 。'
testString: assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), []);
- text: '<code>destroyer(["tree", "hamburger", 53], "tree", 53)</code>应该返回<code>["hamburger"]</code> 。'
testString: assert.deepEqual(destroyer(["tree", "hamburger", 53], "tree", 53), ["hamburger"]);
- text: '<code>destroyer(["possum", "trollo", 12, "safari", "hotdog", 92, 65, "grandma", "bugati", "trojan", "yacht"], "yacht", "possum", "trollo", "safari", "hotdog", "grandma", "bugati", "trojan")</code>应该返回<code>[12,92,65]</code> 。'
testString: assert.deepEqual(destroyer(["possum", "trollo", 12, "safari", "hotdog", 92, 65, "grandma", "bugati", "trojan", "yacht"], "yacht", "possum", "trollo", "safari", "hotdog", "grandma", "bugati", "trojan"), [12,92,65]);
Challenge Seed
function destroyer(arr) {
// Remove all the values
return arr;
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Solution
// solution required