From fd8c9e469ceb9dd94deadb2b371c86075e46eab3 Mon Sep 17 00:00:00 2001 From: John Kennedy Date: Mon, 30 Jul 2018 13:16:38 +0100 Subject: [PATCH] fix(challenges): fixes escaping of and test error message --- .../02-javascript-algorithms-and-data-structures/es6.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/challenges/02-javascript-algorithms-and-data-structures/es6.json b/challenges/02-javascript-algorithms-and-data-structures/es6.json index 009e83f65..3528bd660 100644 --- a/challenges/02-javascript-algorithms-and-data-structures/es6.json +++ b/challenges/02-javascript-algorithms-and-data-structures/es6.json @@ -996,7 +996,7 @@ "
const person = {
  name: \"Zodiac Hasbro\",
  age: 56
};

// Template literal with multi-line and string interpolation
const greeting = `Hello, my name is ${person.name}!
I am ${person.age} years old.`;

console.log(greeting); // prints
// Hello, my name is Zodiac Hasbro!
// I am 56 years old.
", "A lot of things happened there.", "Firstly, the example uses backticks (`), not quotes (' or \"), to wrap the string.", - "Secondly, notice that the string is multi-line, both in the code and the output. This saves inserting \n within strings.", + "Secondly, notice that the string is multi-line, both in the code and the output. This saves inserting \\n within strings.", "The ${variable} syntax used above is a placeholder. Basically, you won't have to use concatenation with the + operator anymore. To add variables to strings, you just drop the variable in a template string and wrap it with ${ and }. Similarly, you can include other expressions in your string literal, for example ${a + b}.", "This new way of creating strings gives you more flexibility to create robust strings.", "
", @@ -1017,7 +1017,7 @@ { "text": "Template strings were used", "testString": - "getUserInput => assert(getUserInput('index').match(/`.*`/g), 'Template strings were used');" + "getUserInput => assert(getUserInput('index').match(/`.*`/g), 'Template strings were not used');" } ], "releasedOn": "Feb 17, 2017",