From b7c8e5f20a7c86ebaf7aaf0e10c202fb0092144a Mon Sep 17 00:00:00 2001 From: Abhisek Pattnaik Date: Sat, 26 Dec 2015 21:26:59 +0530 Subject: [PATCH] Comparisons with the Logical And Operator --- .../basic-javascript.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json index 1067f053a3..41fcec2160 100644 --- a/challenges/01-front-end-development-certification/basic-javascript.json +++ b/challenges/01-front-end-development-certification/basic-javascript.json @@ -2692,9 +2692,11 @@ "description": [ "Sometimes you will need to test more than one thing at a time. The logical and operator (&&) returns true if and only if the operands to the left and right of it are true.", "The same effect could be achieved by nesting an if statement inside another if:", - "
if (num < 10) {
if (num > 5) {
return \"Yes\";
}
}
return \"No\";
Will only return \"Yes\" if num is between 6 and 9. The same logic can be written as:
if (num < 10 && num > 5) {
return \"Yes\";
}
return \"No\";
", + "
if (num > 5) {
if (num < 10) {
return \"Yes\";
}
}
return \"No\";
", + "will only return \"Yes\" if num is between 6 and 9 (6 and 9 included). The same logic can be written as:", + "
if (num > 5 && num < 10) {
return \"Yes\";
}
return \"No\";
", "

Instructions

", - "Combine the two if statements into one statement which returns \"Yes\" if val is less than or equal to 50 and greater than or equal to 25. Otherwise, return \"No\"." + "Combine the two if statements into one statement which will return \"Yes\" if val is less than or equal to 50 and greater than or equal to 25. Otherwise, will return \"No\"." ], "releasedOn": "11/27/2015", "tests": [