Feedback for: "Comparisons with the Logical Or Operator"

Hello, I notice a few other support topics on this particular challenge so I’d like to bring something to the attention of the FCC staff. I think the Instructions need a small tweak.

This line specifically:

…if val is not between 10 and 20, inclusive.

The word inclusive threw me off when I was working on it. I interpreted that to mean including 10 and 20, but if we do that the tests fail.

Examples:
This includes 10 and 20:

if (val <= 10 || val >= 20) {
    return "Outside";
}

This excludes 10 and 20:

if (val < 10 || val > 20) {
    return "Outside";
}

The tests pass with the latter but the Instructions call for inclusion.

I don’t need any support. It is ok to close this. I am moving on with the course, but I want to let someone at FCC know about it.

The instructions are correct. “…not between 10 and 20, inclusive” means “The number is not within the range of numbers from 10 to 20, inclusive”.

Hi Randell,
I’m not a word-smith but maybe something like this, depending on the expected outcome:

If you want 10 and 20 to be included:

Combine the two if statements into one statement which returns “Outside” if val is not between 10 and 20, but can equal 10 or 20. Otherwise, return “Inside”.

If you don’t want 10 and 20 to be included:

Combine the two if statements into one statement which returns “Outside” if val is not between 10 and 20, and does not equal 10 or 20. Otherwise, return “Inside”.

PortableStick, and I’m ok with that but I interpreted it differently and I’m sure others have too. Inclusive can mean two different things in this situation. Include 10 and 20 or only include the range of numbers.

I understand the confusion. As often happens, simple is better. And the wording

would have been clearer with the “inclusive” part excluded:

I can appreciate that there can be many interpretations for those unfamiliar with the way math concepts are expressed in language, and I don’t mean to simply dismiss your feedback, nor do I have any authority over this matter, but there’s a good reason why it is the way it is. My point is that the wording is not a stylistic choice on the part of the challenge’s author, but simply the way that this sort of parameter is normally described in mathematics. The use of “inclusive”, as well as “exclusive”, is normal and not uncommon in these sorts of algorithm challenges. Even if we were to make accommodations in the FreeCodeCamp curriculum, you’d run into the exact same phrasing somewhere else. Problem is, the curriculum is meant to prepare you for interviews and other challenges. You may be somewhat frustrated by the challenge’s wording now, but imagine having gone through all of the certifications - months of hard work - and then being confounded by the same wording during an interview because you had never seen it before.

2 Likes

excellent response, PS. Makes sense.

I just ran across this in “Generate Random Fractions with JavaScript.”

‘…a random decimal number between 0 (inclusive) and not quite up to 1 (exclusive).’

So it turns out that the usage of inclusive is not consistent. This time, it includes the number in question: "0’.

This would in fact produce 0:
console.log(Math.floor(Math.random()))

These questions seem to be avoiding the most logical language, presumably because someone thought it would ‘give the game away’ ie;

The first one could be written: "if val is less than 10 or greater than 20"
and the second: “a random decimal number greater-than or equal to 0 and less than 1”

no inconsistency with that challenge. I am referring to it being inconsistent with the first challenge I started the thread with: “Comparisons with the Logical Or Operator”

In that challenge 10 and 20 are not included, when it uses the word inclusive.

In “Generate Random Fractions with JavaScript” 0 is included when using the word inclusive.

I found another one in “Generate Random Whole Numbers within a Range.” The word inclusive is used to mean that the parameters “myMin” and “myMax” are included.

I won’t point out any more. I don’t want to come across as a jerk. Just wanted to bring it up so it was known. Thanks for the guidance. : )

What you’re missing with the first one, I think, is that 10 are 20 are included in the range that you should be outside. So you need to be outside the range inclusive of 10 and 20. It’s technically correct.

So, the wording was chosen to match the wording there? The wording “and not quite up to 1” is still a potentially confusing and imprecise when you could just write “and less than 1”.

And I interpret that differently. The word “not” is only referring to “not between.” I don’t see how the word “not” is referring to “not including 10 and 20.” I think that is point actually. It’s ambiguous. I think we should consider people who speak English as a second language as well.

I’m surprised to learn that you didn’t write the MDN documentation. Thanks for clearing that up.

I still think the wording could be clearer and you started by asking “How would you word it to make it more clear for others?”. I don’t see any reason not to make it as clear as possible.

Just to be clear, imo “up to but not including 1” is fine, whereas “not quite up to 1” is mathematically meaningless without further clarification.