Files
freeCodeCamp/curriculum/challenges/arabic/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.md
2022-10-20 09:13:17 -07:00

1.9 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
56533eb9ac21ba0edf2244d3 المقارنات باستخدام لا مساواة الصارمة 1 https://scrimba.com/c/cKekkUy 16791 comparison-with-the-strict-inequality-operator

--description--

مشغل لا مساواة الصارمة (!==) هو المضاد المنطقي لمشغل المساواة الصارمة. إنه يعني "ليس متساوياً تماماً" (Strictly Not Equal) ويعيد false عندما تعيد المساواة الصارمة true و العكس صحيح. ولن يحول مشغِّل لا المساواة الصارمة أنواع البيانات.

على سبيل المثال

3 !==  3  // false
3 !== '3' // true
4 !==  3  // true

--instructions--

استخدام مشغل لا مساواة صارمة في تعبير if حتي تعيد الوظيفة مقطع Not Equal عندما يكون val لا مساواة صارمة إلى 17

--hints--

يجب أن ينتج testStrictNotEqual(17) مقطع Equal

assert(testStrictNotEqual(17) === 'Equal');

يجب أن ينتج testStrictNotEqual("17") مقطع Not Equal

assert(testStrictNotEqual('17') === 'Not Equal');

يجب أن ينتج testStrictNotEqual(12) مقطع Not Equal

assert(testStrictNotEqual(12) === 'Not Equal');

يجب أن ينتج testStrictNotEqual("bob") مقطع Not Equal

assert(testStrictNotEqual('bob') === 'Not Equal');

يجب عليك استخدام المشغل !==

assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0);

--seed--

--seed-contents--

// Setup
function testStrictNotEqual(val) {
  if (val) { // Change this line
    return "Not Equal";
  }
  return "Equal";
}

testStrictNotEqual(10);

--solutions--

function testStrictNotEqual(val) {
  if (val !== 17) {
    return "Not Equal";
  }
  return "Equal";
}