From 3715d0b4668234fc98692b6a8305034bcc8a2686 Mon Sep 17 00:00:00 2001 From: BKinahan Date: Wed, 13 Apr 2016 13:35:46 +0000 Subject: [PATCH] Update Conditional Logic tests and description --- .../basic-javascript.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json index c3f67fdfcd..413259e374 100644 --- a/challenges/01-front-end-development-certification/basic-javascript.json +++ b/challenges/01-front-end-development-certification/basic-javascript.json @@ -2592,7 +2592,7 @@ "
function test (myCondition) {
if (myCondition) {
return \"It was true\";
}
return \"It was false\";
}
test(true); // returns \"It was true\"
test(false); // returns \"It was false\"
", "When test is called with a value of true, the if statement evaluates myCondition to see if it is true or not. Since it is true, the function returns \"It was true\". When we call test with a value of false, myCondition is not true and the statement in the curly braces is not executed and the function returns \"It was false\".", "

Instructions

", - "Create an if statement inside the function to return \"That was true\" if the parameter wasThatTrue is true and return \"That was false\" otherwise." + "Create an if statement inside the function to return \"Yes, that was true\" if the parameter wasThatTrue is true and return \"No, that was false\" otherwise." ], "challengeSeed": [ "// Example", @@ -2618,14 +2618,14 @@ "trueOrFalse(true);" ], "solutions": [ - "function trueOrFalse(wasThatTrue) {\n if (wasThatTrue) {\n return \"That was true\";\n }\n return \"That was false\";\n}" + "function trueOrFalse(wasThatTrue) {\n if (wasThatTrue) {\n return \"Yes, that was true\";\n }\n return \"No, that was false\";\n}" ], "tests": [ "assert(typeof trueOrFalse === \"function\", 'message: trueOrFalse should be a function');", "assert(typeof trueOrFalse(true) === \"string\", 'message: trueOrFalse(true) should return a string');", "assert(typeof trueOrFalse(false) === \"string\", 'message: trueOrFalse(false) should return a string');", - "assert(trueOrFalse(true) === \"That was true\", 'message: trueOrFalse(true) should return \"That was true\"');", - "assert(trueOrFalse(false) === \"That was false\", 'message: trueOrFalse(false) should return \"That was false\"');" + "assert(trueOrFalse(true) === \"Yes, that was true\", 'message: trueOrFalse(true) should return \"Yes, that was true\"');", + "assert(trueOrFalse(false) === \"No, that was false\", 'message: trueOrFalse(false) should return \"No, that was false\"');" ], "type": "waypoint", "challengeType": 1,