diff --git a/seed/challenges/01-front-end-development-certification/basic-javascript.json b/seed/challenges/01-front-end-development-certification/basic-javascript.json
index 55d06bfed2f..d646a637a3d 100644
--- a/seed/challenges/01-front-end-development-certification/basic-javascript.json
+++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json
@@ -2652,6 +2652,47 @@
"type": "waypoint",
"challengeType": 1
},
+ {
+ "id": "5690307fddb111c6084545d7",
+ "title": "Logical Order in If Else Statements",
+ "description": [
+ "Order is important in if
, else if
statements.",
+ "The loop is executed from top to bottom so you will want to be careful of what statement comes first.",
+ "Take these two functions as an example.",
+ "Heres the first:",
+ "
function foo(x) {", + "And the second just switches the order of the statements:", + "
if (x < 1) {
return \"Less than one\";
} else if (num < 2) {
return \"Less than two\";
} else {
return \"Greater than or equal to two\";
}
}
function bar(x) {", + "While these two functions look nearly identical if we pass a number to both we get different outputs.", + "
if (x < 2) {
return \"Less than two\";
} else if (num < 1) {
return \"Less than one\";
} else {
return \"Greater than or equal to two\";
}
}
foo(0) // \"Less than one\"", + "
bar(0) // \"Less than two\"
myTest(5)
should return \"Less than 5\"');",
+ "assert(myTest(6) === \"Less than 10\", 'message: myTest(6)
should return \"Less than 10\"');",
+ "assert(myTest(11) === \"Greater than or equal to 10\", 'message: myTest(11)
should return \"Greater than or equal to 10\"');"
+ ],
+ "type": "waypoint",
+ "challengeType": 1
+ },
{
"id": "56533eb9ac21ba0edf2244dc",
"title": "Chaining If Else Statements",