{
    "componentChunkName": "component---src-templates-challenges-classic-show-tsx",
    "path": "/learn/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator",
    "result": {"data":{"challengeNode":{"challenge":{"block":"basic-javascript","title":"Comparison with the Strict Equality Operator","description":"<section id=\"description\">\n<p>Strict equality (<code>===</code>) is the counterpart to the equality operator (<code>==</code>). However, unlike the equality operator, which attempts to convert both values being compared to a common type, the strict equality operator does not perform a type conversion.</p>\n<p>If the values being compared have different types, they are considered unequal, and the strict equality operator will return false.</p>\n<p><strong>Examples</strong></p>\n<pre><code class=\"language-js\">3 ===  3  // true\n3 === '3' // false\n</code></pre>\n<p>In the second example, <code>3</code> is a <code>Number</code> type and <code>'3'</code> is a <code>String</code> type.</p>\n</section>","hasEditableBoundaries":false,"instructions":"<section id=\"instructions\">\n<p>Use the strict equality operator in the <code>if</code> statement so the function will return the string <code>Equal</code> when <code>val</code> is strictly equal to <code>7</code>.</p>\n</section>","notes":null,"removeComments":null,"challengeType":1,"helpCategory":"JavaScript","videoUrl":"https://scrimba.com/c/cy87atr","superBlock":"javascript-algorithms-and-data-structures","certification":"javascript-algorithms-and-data-structures","translationPending":false,"forumTopicId":16790,"fields":{"blockName":"Basic JavaScript","slug":"/learn/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator","tests":[{"text":"<p><code>testStrict(10)</code> should return the string <code>Not Equal</code></p>","testString":"assert(testStrict(10) === 'Not Equal');"},{"text":"<p><code>testStrict(7)</code> should return the string <code>Equal</code></p>","testString":"assert(testStrict(7) === 'Equal');"},{"text":"<p><code>testStrict(\"7\")</code> should return the string <code>Not Equal</code></p>","testString":"assert(testStrict('7') === 'Not Equal');"},{"text":"<p>You should use the <code>===</code> operator</p>","testString":"assert(code.match(/(val\\s*===\\s*\\d+)|(\\d+\\s*===\\s*val)/g).length > 0);"}]},"required":[],"usesMultifileEditor":false,"challengeFiles":[{"fileKey":"scriptjs","ext":"js","name":"script","contents":"// Setup\nfunction testStrict(val) {\n  if (val) { // Change this line\n    return \"Equal\";\n  }\n  return \"Not Equal\";\n}\n\ntestStrict(10);","head":"","tail":"","editableRegionBoundaries":[],"history":["script.js"]}]}}},"pageContext":{"challengeMeta":{"certification":"javascript-algorithms-and-data-structures","superBlock":"javascript-algorithms-and-data-structures","block":"basic-javascript","template":"","required":[],"nextChallengePath":"/learn/javascript-algorithms-and-data-structures/basic-javascript/practice-comparing-different-values","prevChallengePath":"/learn/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-equality-operator","id":"56533eb9ac21ba0edf2244d1"},"projectPreview":{"showProjectPreview":false,"challengeData":{"challengeType":1,"challengeFiles":[{"name":"script","ext":"js","contents":"function rangeOfNumbers(startNum, endNum) {\n  if (endNum - startNum === 0) {\n    return [startNum];\n  } else {\n    const numbers = rangeOfNumbers(startNum, endNum - 1);\n    numbers.push(endNum);\n    return numbers;\n  }\n}","head":"","tail":"","history":["script.js"]}]}},"slug":"/learn/javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-equality-operator"}},
    "staticQueryHashes": ["3216307819","3851966407"]}