Comparison with the Inequality Operator challenge raise false error when used "99" in conditional
See original GitHub issueChallenge Comparison with the Inequality Operator has an issue.
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.87 Safari/537.36 OPR/37.0.2178.32
.
My code:
// Setup
function testNotEqual(val) {
if (val != '99') { // Change this line
return "Not Equal";
}
return "Equal";
}
// Change this value to test
testNotEqual(10);
The challenge should be passed with both '99'
and 99
value in the if condition test. But it only passes those who used 99
. Those using '99'
passes all test but reports an error saying You should use the != operator
I’ve uploaded an screenshot here.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Comparison with the Inequality Operator, freeCodeCamp ...
In this challenge we learn about the inequality operator which is basically the opposite of the equality operator. The inequality operator ...
Read more >Inequality (!=) - JavaScript - MDN Web Docs - Mozilla
The inequality (!=) operator checks whether its two operands are not equal, returning a Boolean result. Unlike the strict inequality operator, ...
Read more >Excel IF AND OR Functions Explained - My Online Training Hub
The OR function is useful when you are happy if one, OR another condition is met. In Excel language on its own the...
Read more >RobotC Programming Guide.pdf
The “result” of a comparison is either true or false, but the robot takes it one step further. The program will actually substitute...
Read more >WEEK 2 :: PYTHON CRASH COURSE Flashcards - Quizlet
The conditional operator == checks if two values are equal. The result of that operation is a boolean: either True or False.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If we’re asking someone to use the loose equal in the challenge I don’t thinks it’s unreasonable for them to play around with how it actually works by using a string. I personally feel this should be fixed to allow it, since the code passes all the functionality based teats.
// Setup function testNotEqual(val) { if (val != 99) { // Change this line (note: u don’t have to put 99 into ’ '). return “Not Equal”; } return “Equal”; }
// Change this value to test testNotEqual(10);