Files
freeCodeCamp/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/comparison-with-the-strict-inequality-operator.md
camperbot 7c3cbbbfd5 chore(i18n,learn): processed translations (#41416)
* chore(i8n,learn): processed translations

* Update curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/use-the-u-tag-to-underline-text.md

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com>
Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
2021-03-08 06:28:46 -08:00

1.8 KiB

id, title, challengeType, videoUrl, forumTopicId, dashedName
id title challengeType videoUrl forumTopicId dashedName
56533eb9ac21ba0edf2244d3 Comparación con el operador de estricta desigualdad 1 https://scrimba.com/c/cKekkUy 16791 comparison-with-the-strict-inequality-operator

--description--

El operador de estricta desigualdad !== es el opuesto lógico del operador de estricta igualdad. Esto significa "Estrictamente No Igual", y devuelve false cuando la comparación de estricta igualdad devolvería true y vice versa. Una estricta desigualdad no convertirá los tipos de datos.

Ejemplos

3 !==  3
3 !== '3'
4 !==  3

En orden, estas expresiones se evaluarían como false, true y true.

--instructions--

Agrega el operador de estricta desigualdad a la sentencia if para que la función devuelva la cadena Not Equal cuando val no sea estrictamente igual a 17

--hints--

testStrictNotEqual(17) debe devolver la cadena Equal

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

testStrictNotEqual("17") debe devolver la cadena Not Equal

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

testStrictNotEqual(12) debe devolver la cadena Not Equal

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

testStrictNotEqual("bob") debe devolver la cadena Not Equal

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

Debes usar el operador !==

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";
}