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