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 4cce7dc64d..198a4e064c 100644
--- a/seed/challenges/01-front-end-development-certification/basic-javascript.json
+++ b/seed/challenges/01-front-end-development-certification/basic-javascript.json
@@ -1036,10 +1036,14 @@
"title": "Escape Sequences in Strings",
"description": [
"Quotes are not the only characters that can be escaped inside a string. Here is a table of common escape sequences:",
- "
Code | Output |
---|
\\' | single quote |
\\\" | double quote |
\\\\ | backslash |
\\n | new line |
\\r | carriage return |
\\t | tab |
\\b | backspace |
\\f | form feed |
",
+ "Code | Output |
---|
\\' | single quote |
\\\" | double quote |
\\\\ | backslash |
\\n | new line |
\\r | carriage return |
\\t | tab |
\\b | backspace |
\\f | form feed |
",
"Note that the backslash itself must be escaped in order to display as a backslash.",
"Instructions
",
- "Encode the following sequence, separated by spaces:
backslash tab tab carriage-return new-line
and assign it to myStr
"
+ "Assign the following two lines of text into the single variable myStr
using escape sequences.",
+ "Here is a backslash: \\.
Here is a new line with two tabs.
",
+ "You will need to use escape sequences to insert special characters correctly. You will also need to follow the spacing as it looks above with no additional spaces between each escape sequence.",
+ "Here is the text with the escape sequences written out.",
+ "Here is a backslash: backslash
.newline
tab
tab
Here is a new line with two tabs.
"
],
"releasedOn": "January 1, 2016",
"challengeSeed": [
@@ -1054,10 +1058,14 @@
"else{return null;}})();"
],
"solutions": [
- "var myStr = \"\\\\ \\t \\t \\r \\n\";"
+ "var myStr = \"Here is a backslash: \\\\.\\n\\t\\tHere is a new line with two tabs.\";"
],
"tests": [
- "assert(myStr === \"\\\\ \\t \\t \\r \\n\", 'message: myStr
should have the escape sequences for backslash tab tab carriage-return new-line
separated by spaces');"
+ "assert(myStr === \"Here is a backslash: \\\\.\\n\\t\\tHere is a new line with two tabs.\", 'message: myStr
should have encoded text with the proper escape sequences and spacing.');",
+ "assert(myStr.match(/\\t/g).length == 2, 'message: myStr
should have two tab characters \\t
');",
+ "assert(myStr.match(/\\n/g).length == 1, 'message: myStr
should have one newline character \\n
');",
+ "assert(myStr.match(/\\\\/g).length == 1, 'message: myStr
should have a correctly escaped backslash character \\\\
');",
+ "assert(myStr === \"Here is a backslash: \\\\.\\n\\t\\tHere is a new line with two tabs.\", 'message: myStr
should not have any spaces in between consecutive escape sequences.');"
],
"type": "waypoint",
"challengeType": 1,