question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Comparison with the Inequality Operator challenge raise false error when used "99" in conditional

See original GitHub issue

Challenge 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. screenshot from 2016-05-28 12-37-40

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
ltegmancommented, May 29, 2016

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.

0reactions
rubber2018commented, Mar 1, 2018

// 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);

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found