2018-10-10 18:03:03 -04:00
---
id: af2170cad53daa0770fabdea
title: Mutations
isRequired: true
challengeType: 5
videoUrl: ''
localeTitle: الطفرات
---
## Description
2019-11-19 19:54:48 -05:00
< section id = "description" > إرجاع true إذا احتوت السلسلة في العنصر الأول من المصفوفة على كافة أحرف السلسلة في العنصر الثاني من الصفيف. على سبيل المثال ، يجب أن تعود < code > [" hello" , " Hello" ]< / code > ، true لأن كافة الأحرف الموجودة في السلسلة الثانية موجودة في الحالة الأولى ، مع تجاهل الحالة. يجب أن ترجع الوسيطة < code > [" hello" , " hey" ]< / code > false لأن السلسلة " hello" لا تحتوي على " y" . وأخيرًا ، يجب أن تعود < code > [" Alien" , " line" ]< / code > ، إلى true لأن جميع الأحرف في " line" موجودة في " Alien" . تذكر استخدام < a href = "https://www.freecodecamp.org/forum/t/how-to-get-help-when-you-are-stuck-coding/19514" target = "_blank" > Read-Search-Ask< / a > إذا واجهتك مشكلة. اكتب الكود الخاص بك. < / section >
2018-10-10 18:03:03 -04:00
## Instructions
< section id = "instructions" >
< / section >
## Tests
< section id = 'tests' >
```yml
tests:
- text: 'يجب أن تعود < code > mutation([" hello" , " hey" ])</ code > false.'
testString: 'assert(mutation(["hello", "hey"]) === false, "< code > mutation(["hello", "hey"])< / code > should return false.");'
- text: 'يجب أن تعود < code > mutation([" hello" , " Hello" ])</ code > true.'
testString: 'assert(mutation(["hello", "Hello"]) === true, "< code > mutation(["hello", "Hello"])< / code > should return true.");'
- text: 'يجب أن ترجع < code > mutation([" zyxwvutsrqponmlkjihgfedcba" , " qrstu" ])</ code > صحيح.'
testString: 'assert(mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"]) === true, "< code > mutation(["zyxwvutsrqponmlkjihgfedcba", "qrstu"])< / code > should return true.");'
- text: 'يجب أن تعود < code > mutation([" Mary" , " Army" ])</ code > الحقيقة.'
testString: 'assert(mutation(["Mary", "Army"]) === true, "< code > mutation(["Mary", "Army"])< / code > should return true.");'
- text: 'يجب أن تعود < code > mutation([" Mary" , " Aarmy" ])</ code > true.'
testString: 'assert(mutation(["Mary", "Aarmy"]) === true, "< code > mutation(["Mary", "Aarmy"])< / code > should return true.");'
- text: 'يجب أن تعود < code > mutation([" Alien" , " line" ])</ code > true.'
testString: 'assert(mutation(["Alien", "line"]) === true, "< code > mutation(["Alien", "line"])< / code > should return true.");'
- text: 'يجب أن تعود < code > mutation([" floor" , " for" ])</ code > true.'
testString: 'assert(mutation(["floor", "for"]) === true, "< code > mutation(["floor", "for"])< / code > should return true.");'
- text: 'يجب أن تعود < code > mutation([" hello" , " neo" ])</ code > false.'
testString: 'assert(mutation(["hello", "neo"]) === false, "< code > mutation(["hello", "neo"])< / code > should return false.");'
- text: 'يجب أن تعود < code > mutation([" voodoo" , " no" ])</ code > كاذبة.'
testString: 'assert(mutation(["voodoo", "no"]) === false, "< code > mutation(["voodoo", "no"])< / code > should return false.");'
```
< / section >
## Challenge Seed
< section id = 'challengeSeed' >
< div id = 'js-seed' >
```js
function mutation(arr) {
return arr;
}
mutation(["hello", "hey"]);
```
< / div >
< / section >
## Solution
< section id = 'solution' >
```js
// solution required
```
< / section >