From 23768acc7f0736477c82ce7466a44ca300a4695b Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Wed, 25 Nov 2015 21:48:16 -0800 Subject: [PATCH] Fix example if-else statements with clearer example --- challenges/basic-javascript.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/challenges/basic-javascript.json b/challenges/basic-javascript.json index 7e2808499d..5d3b8924ec 100644 --- a/challenges/basic-javascript.json +++ b/challenges/basic-javascript.json @@ -1143,10 +1143,11 @@ "We can use if statements in JavaScript to only execute code if a certain condition is met.", "if statements require some sort of boolean condition to evaluate.", "For example:", - "if (1 === 2) {", - "  return true;", + "var x = 1;", + "if (x === 2) {", + "  return 'x is 2';", "} else {", - "  return false;", + "  return 'x is not 2';", "}", "Let's use if and else statements to make a coin-flip game.", "Create if and else statements to return the string \"heads\" if the flip variable is zero, or else return the string \"tails\" if the flip variable is not zero."