Comparisons with the Logical Or Operator
See original GitHub issueChallenge Comparisons with the Logical Or Operator has an issue.
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
function myTest(val) {
// Only change code below this line
if (val <= 10 || val >= 20) {
return "Outside";
}
// Only change code above this line
return "Inside";
}
// Change this value to test
myTest(15);
Without the numbers 10 and 20 being inclusive, the code runs but there seems to be a problem when you include them and run the solution. Maybe the instructions should be different.
Issue Analytics
- State:
- Created 8 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Comparisons with the Logical Or Operator - CodeChallenge
Comparisons with the Logical Or Operator. The logical or operator ( || ) returns true if either of the operands is true ....
Read more >Comparison and Logical Operators - Codecademy
Comparison operators — operators that compare values and return true or false . The operators include: > , < , >= , <=...
Read more >Comparisons with the Logical Or Operator help - JavaScript
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-or-operator.
Read more >Understanding Comparison and Logical Operators in JavaScript
Similarly, the operator for greater than or equal to will evaluate whether one operand meets the threshold of the other. This operator is...
Read more >Logical OR (||) - JavaScript - MDN Web Docs - Mozilla
The logical OR (||) (logical disjunction) operator for a set of operands is true if and only if one or more of its...
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
This is very confusing wording. This needs to be changed.
Also this doesn’t work for me… function test(val) { // Only change code below this line if(val > 20 || val < 10) { return “Outside”; }
// Only change code above this line return “Inside”; }
// Change this value to test test(15);
function myTest(val) { // Only change code below this line
if (val > 20 || val < 10) { return “Outside”; }
// Only change code above this line return “Inside”; }
// Change this value to test myTest(15);
This is the code that managed to run and in that case 20 and 10 are not inclusive.