72 lines
2.7 KiB
Markdown
72 lines
2.7 KiB
Markdown
|
---
|
||
|
id: 56533eb9ac21ba0edf2244d3
|
||
|
title: Comparison with the Strict Inequality Operator
|
||
|
challengeType: 1
|
||
|
videoUrl: ''
|
||
|
localeTitle: مقارنة مع مشغل عدم المساواة الصارم
|
||
|
---
|
||
|
|
||
|
## Description
|
||
|
<section id="description"> إن عامل عدم المساواة الصارم ( <code>!==</code> ) هو المقابل المنطقي للمشغل الصارم للمساواة. ويعني "عدم التساوي في الدقة" ويعود <code>false</code> حيث تعود المساواة الصارمة إلى <code>true</code> <em>والعكس صحيح</em> . عدم المساواة الصارمة لن تقوم بتحويل أنواع البيانات. <strong>أمثلة</strong> <blockquote style=";text-align:right;direction:rtl"> 3! == 3 // false <br> 3! == '3' // true <br> 4! == 3 // صحيح </blockquote></section>
|
||
|
|
||
|
## Instructions
|
||
|
<section id="instructions"> إضافة <code>strict inequality operator</code> إلى العبارة <code>if</code> بحيث تقوم الدالة بإرجاع "غير مساوي" عندما لا يكون <code>val</code> مساوياً تمامًا لـ <code>17</code> </section>
|
||
|
|
||
|
## Tests
|
||
|
<section id='tests'>
|
||
|
|
||
|
```yml
|
||
|
tests:
|
||
|
- text: <code>testStrictNotEqual(17)</code> إرجاع "مساواة"
|
||
|
testString: 'assert(testStrictNotEqual(17) === "Equal", "<code>testStrictNotEqual(17)</code> should return "Equal"");'
|
||
|
- text: <code>testStrictNotEqual("17")</code> "غير مساوي"
|
||
|
testString: 'assert(testStrictNotEqual("17") === "Not Equal", "<code>testStrictNotEqual("17")</code> should return "Not Equal"");'
|
||
|
- text: يجب أن <code>testStrictNotEqual(12)</code> "غير مساوي"
|
||
|
testString: 'assert(testStrictNotEqual(12) === "Not Equal", "<code>testStrictNotEqual(12)</code> should return "Not Equal"");'
|
||
|
- text: <code>testStrictNotEqual("bob")</code> "غير مساوي"
|
||
|
testString: 'assert(testStrictNotEqual("bob") === "Not Equal", "<code>testStrictNotEqual("bob")</code> should return "Not Equal"");'
|
||
|
- text: يجب عليك استخدام <code>!==</code> المشغل
|
||
|
testString: 'assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0, "You should use the <code>!==</code> operator");'
|
||
|
|
||
|
```
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Challenge Seed
|
||
|
<section id='challengeSeed'>
|
||
|
|
||
|
<div id='js-seed'>
|
||
|
|
||
|
```js
|
||
|
// Setup
|
||
|
function testStrictNotEqual(val) {
|
||
|
// Only Change Code Below this Line
|
||
|
|
||
|
if (val) {
|
||
|
|
||
|
// Only Change Code Above this Line
|
||
|
|
||
|
return "Not Equal";
|
||
|
}
|
||
|
return "Equal";
|
||
|
}
|
||
|
|
||
|
// Change this value to test
|
||
|
testStrictNotEqual(10);
|
||
|
|
||
|
```
|
||
|
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</section>
|
||
|
|
||
|
## Solution
|
||
|
<section id='solution'>
|
||
|
|
||
|
```js
|
||
|
// solution required
|
||
|
```
|
||
|
</section>
|