From a6d796fb881b0bd364863131b9cb9b4abc86fafc Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Sat, 26 Dec 2015 21:40:52 +0530 Subject: [PATCH] Comparisons with the Logical Or Operator --- .../basic-javascript.json | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json index 41fcec2160..ea7a6b36f5 100644 --- a/challenges/01-front-end-development-certification/basic-javascript.json +++ b/challenges/01-front-end-development-certification/basic-javascript.json @@ -2748,11 +2748,13 @@ "id": "56533eb9ac21ba0edf2244d9", "title": "Comparisons with the Logical Or Operator", "description": [ - "The logical or operator (||) returns true if either ofoperands is true, or false if neither is true.", + "The logical or operator (||) returns true if either ofoperands is true. Otherwise, it returns false.", "The pattern below should look familiar from prior waypoints:", - "
if (num > 10) {
return \"No\";
}
if (num < 5) {
return \"No\";
}
return \"Yes\";
Will only return \"Yes\" if num is between 5 and 10. The same logic can be written as:
if (num > 10 || num < 5) {
return \"No\";
}
return \"Yes\";
", + "
if (num > 10) {
return \"No\";
}
if (num < 5) {
return \"No\";
}
return \"Yes\";
", + "will return \"Yes\" only if num is between 5 and 10 (5 and 10 included). The same logic can be written as:", + "
if (num > 10 || num < 5) {
return \"No\";
}
return \"Yes\";
", "

Instructions

", - "Combine the two if statements into one statement which returns \"Inside\" if val is between 10 and 20, inclusive. Otherwise, return \"Outside\"." + "Combine the two if statements into one statement which returns \"Inside\" if val is between 10 and 20, inclusive. Otherwise, return \"Outside\"." ], "releasedOn": "11/27/2015", "tests": [