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.

An typo in a code description - 'if' statement, closed interval

See original GitHub issue

Challenge Comparisons with the Logical And Operator has an issue. User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3; rv:11.0) like Gecko. Please describe how to reproduce this issue, and include links to screenshots if possible.

In this Challenge, there is a part concerning an if statement:

issue

I think there is a mistake in a description of logic behind this code snippet as this if statement will return “Yes” if num is between 5 and 10 (5 and 10 excluded). According to your description, any number in a range (5, 6) and (9, 10) will return false, but it is not true.

My code:

function testLogicalAnd(val) {
  // Only change code below this line

  if (val >= 25 && val <= 50) {
    return "Yes";
  }

  // Only change code above this line
  return "No";
}

// Change this value to test
testLogicalAnd(25.001);

As you can see, this value is causing a function to return true, which is correct.

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
gczarnockicommented, Aug 11, 2016

@raisedadead Yes, I agree 100%. Are pull requests restricted only to those who create an issue, or just anybody, who’s faster? I can submit a change today, if you don’t mind.

2reactions
dhcodescommented, Aug 11, 2016

@gczarnocki I already started writing this for first-timers, but if that’s you, go for it:

To fix this, in seed/challenges/01-front-end-development-certification/basic-javascript.json

change the line: will only return \"Yes\" if <code>num</code> is between <code>6</code> and <code>9</code> (6 and 9 included).

to: will only return \"Yes"\ if <code>num</code> is greater than <code>5</code> and less than <code>10</code>.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Open and closed intervals in the if statement - SAS Communities
My code can't use the syntax "IF X ge z1 and x le z2 then do Y", as there must be only a...
Read more >
Check If a number is contained in an interval without using "if ...
A basic example is [1,6] or (1,6) or a mixed of both open and closed. So, 5 would be in the interval. I...
Read more >
Typo (Typographical Error) | What is One Example of a Typo?
' Duplication, Omission, and Punctuation Typos. Some typos occur during the editing process of a text. If you finish writing a sentence then...
Read more >
5. Conditionals — How to Think Like a Computer Scientist
A Boolean expression is an expression that evaluates to produce a result which is a Boolean value. For example, the operator == tests...
Read more >
IF Statement Between Two Numbers - YouTube
In Excel, you can combine IF with AND functions to return a value based on two different numbers. This can be very useful...
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