--- id: adf08ec01beb4f99fc7a68f2 title: Falsy Bouncer isRequired: true challengeType: 5 videoUrl: '' localeTitle: فلسى الحارس --- ## Description
قم بإزالة كافة قيم الفالسة من صفيف. تكون قيم Falsy في JavaScript false و null و 0 و "" و undefined و NaN . تلميح: حاول تحويل كل قيمة إلى قيمة منطقية. تذكر استخدام Read-Search-Ask إذا واجهتك مشكلة. اكتب الكود الخاص بك.
## Instructions
## Tests
```yml tests: - text: 'bouncer([7, "ate", "", false, 9]) يجب أن يعود [7, "ate", 9] .' testString: 'assert.deepEqual(bouncer([7, "ate", "", false, 9]), [7, "ate", 9], "bouncer([7, "ate", "", false, 9]) should return [7, "ate", 9].");' - text: 'يجب أن تعود bouncer(["a", "b", "c"]) ["a", "b", "c"] .' testString: 'assert.deepEqual(bouncer(["a", "b", "c"]), ["a", "b", "c"], "bouncer(["a", "b", "c"]) should return ["a", "b", "c"].");' - text: 'bouncer([false, null, 0, NaN, undefined, ""]) يجب أن يرجع [] .' testString: 'assert.deepEqual(bouncer([false, null, 0, NaN, undefined, ""]), [], "bouncer([false, null, 0, NaN, undefined, ""]) should return [].");' - text: 'bouncer([1, null, NaN, 2, undefined]) يجب أن يرجع [1, 2] .' testString: 'assert.deepEqual(bouncer([1, null, NaN, 2, undefined]), [1, 2], "bouncer([1, null, NaN, 2, undefined]) should return [1, 2].");' ```
## Challenge Seed
```js function bouncer(arr) { // Don't show a false ID to this bouncer. return arr; } bouncer([7, "ate", "", false, 9]); ```
## Solution
```js // solution required ```