2.6 KiB
2.6 KiB
id, title, isRequired, challengeType, videoUrl, localeTitle
id | title | isRequired | challengeType | videoUrl | localeTitle |
---|---|---|---|---|---|
af2170cad53daa0770fabdea | Mutations | true | 5 | 突变 |
Description
["hello", "Hello"]
应该返回true,因为第二个字符串中的所有字母都出现在第一个字母中,忽略大小写。参数["hello", "hey"]
应返回false,因为字符串“hello”不包含“y”。最后, ["Alien", "line"]
应该返回true,因为“line”中的所有字母都出现在“Alien”中。如果卡住,请记得使用Read-Search-Ask 。编写自己的代码。 Instructions
Tests
tests:
- text: '<code>mutation(["hello", "hey"])</code>应该返回false。'
testString: assert(mutation(["hello", "hey"]) === false);
- text: '<code>mutation(["hello", "Hello"])</code>应该返回true。'
testString: assert(mutation(["hello", "Hello"]) === true);
- text: '<code>mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])</code>应该返回true。'
testString: assert(mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) === true);
- text: '<code>mutation(["Mary", "Army"])</code>应该返回true。'
testString: assert(mutation(["Mary", "Army"]) === true);
- text: '<code>mutation(["Mary", "Aarmy"])</code>应该返回true。'
testString: assert(mutation(["Mary", "Aarmy"]) === true);
- text: '<code>mutation(["Alien", "line"])</code>应该返回true。'
testString: assert(mutation(["Alien", "line"]) === true);
- text: '<code>mutation(["floor", "for"])</code>应该返回true。'
testString: assert(mutation(["floor", "for"]) === true);
- text: '<code>mutation(["hello", "neo"])</code>应该返回false。'
testString: assert(mutation(["hello", "neo"]) === false);
- text: '<code>mutation(["voodoo", "no"])</code>应该返回false。'
testString: assert(mutation(["voodoo", "no"]) === false);
Challenge Seed
function mutation(arr) {
return arr;
}
mutation(["hello", "hey"]);
Solution
// solution required