diff --git a/challenges/01-front-end-development-certification/basic-javascript.json b/challenges/01-front-end-development-certification/basic-javascript.json index 4074aa8b6c2..91bcbb93210 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) {", "When
if (myCondition) {
return \"It was true\";
}
return \"It was false\";
}
test(true); // returns \"It was true\"
test(false); // returns \"It was false\"
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\".",
"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,