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.

Modify instruction in Challenge Comparison with the Greater Than Or Equal To Operator

See original GitHub issue

Challenge Comparison with the Greater Than Or Equal To Operator has an issue. User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


function testGreaterOrEqual(val) {
  if (val >= '20') {  // Change this line
    return "20 or Over";
  }
  
  if (val >= 10) {  // Change this line
    return "10 or Over";
  }

  return "9 or Under";
}

// Change this value to test
testGreaterOrEqual(9.999999999999999);

image

ISSUE: the above code returns “9 or under” string as the result which is misleading or does not sound right when we use testGreaterOrEqual(9.999999999999999); as the input.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
abhisekpcommented, Nov 15, 2016

Considering the challenge https://www.freecodecamp.com/challenges/comparison-with-the-less-than-or-equal-to-operator with issue https://github.com/FreeCodeCamp/FreeCodeCamp/issues/11663 and the current issue, I think it is better to just modify the challenge seed.

i.e. the challenge seed should read "Less than 10".

1reaction
erictleungcommented, Nov 15, 2016

@abhisekp I like it but I don’t think this would be the place to introduce that. We’d have to introduce them way earlier and change all of the challenges. So I don’t think there would be too much to gain from adding them. But I’m up for discussion on it.

Maybe for the intermediate and advanced algorithms that would be a clean and nice way to specify the parameters.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Comparison with the Greater Than Or Equal To Operator
The greater than or equal to operator ( >= ) compares the values of two numbers. If the number to the left is...
Read more >
Comparison and Logical Operators - Codecademy
Comparison operators allow us to assert the equality of a statement with JavaScript. For example, we can assert whether two values or expressions...
Read more >
PLC Programming Comparison Instructions – GRT - SolisPLC
A step-by-step guide to the GRT (Greater Than) instruction that compares two operands and evaluates if the value stored in “Source A” is...
Read more >
Basic JavaScript: Comparison with the Greater Than Or Equal ...
Tell us what's happening: Hi, on completion of running the test, the output is “less than 10”, however it should be “10 or...
Read more >
Review: Logic and if Statements (article) | Khan Academy
In the code below, we output a message only if x is greater than 0: ... The assignment operator will actually change the...
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