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.

Comparisons with the Logical Or Operator

See original GitHub issue

Challenge 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:closed
  • Created 8 years ago
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
RazzaFrazzacommented, Mar 12, 2016

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

3reactions
tmusimbicommented, Feb 24, 2016

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.

Read more comments on GitHub >

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

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