Fix(challenge): Escaping Quote
Changes the number of matches from the regex to accomodate the additions added through babel and head/tail. Also changes tail to use console.log to print out info
This commit is contained in:
@ -1074,24 +1074,22 @@
|
|||||||
],
|
],
|
||||||
"releasedOn": "January 1, 2016",
|
"releasedOn": "January 1, 2016",
|
||||||
"challengeSeed": [
|
"challengeSeed": [
|
||||||
"var myStr; // Change this line",
|
"var myStr = \"\"; // Change this line",
|
||||||
"",
|
"",
|
||||||
""
|
""
|
||||||
],
|
],
|
||||||
"tail": [
|
"tail": [
|
||||||
"(function(){",
|
"(function(){",
|
||||||
" if(typeof myStr === 'string') {",
|
" if(typeof myStr === 'string') {",
|
||||||
" return \"myStr = \" + myStr;",
|
" console.log(\"myStr = \\\"\" + myStr + \"\\\"\");",
|
||||||
" } else {",
|
" } else {",
|
||||||
" return \"myStr is undefined\";",
|
" console.log(\"myStr is undefined\");",
|
||||||
" }",
|
" }",
|
||||||
"})();"
|
"})();"
|
||||||
],
|
],
|
||||||
"solutions": [
|
"solutions": [],
|
||||||
"var myStr = \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\";"
|
|
||||||
],
|
|
||||||
"tests": [
|
"tests": [
|
||||||
"assert(code.match(/\\\\\"/g).length === 4 && code.match(/[^\\\\]\"/g).length === 2, 'message: You should use two double quotes (<code>"</code>) and four escaped double quotes (<code>\"</code>).');",
|
"assert(code.match(/\\\\\"/g).length === 6 && code.match(/[^\\\\]\"/g).length === 10, 'message: You should use two double quotes (<code>"</code>) and four escaped double quotes (<code>\"</code>).');",
|
||||||
"assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable myStr should contain the string: <code>I am a \"double quoted\" string inside \"double quotes\".</code>');"
|
"assert(myStr === \"I am a \\\"double quoted\\\" string inside \\\"double quotes\\\".\", 'message: Variable myStr should contain the string: <code>I am a \"double quoted\" string inside \"double quotes\".</code>');"
|
||||||
],
|
],
|
||||||
"type": "waypoint",
|
"type": "waypoint",
|
||||||
|
Reference in New Issue
Block a user