Modify instruction in Challenge Comparison with the Greater Than Or Equal To Operator
See original GitHub issueChallenge 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);
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:
- Created 7 years ago
- Comments:7 (6 by maintainers)
Top 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 >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
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"
.@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.