diff --git a/challenges/02-javascript-algorithms-and-data-structures/es6.json b/challenges/02-javascript-algorithms-and-data-structures/es6.json
index 897b00ea1d..772262ff4d 100644
--- a/challenges/02-javascript-algorithms-and-data-structures/es6.json
+++ b/challenges/02-javascript-algorithms-and-data-structures/es6.json
@@ -127,22 +127,26 @@
"let
is not the only new way to declare variables. In ES6, you can also declare variables using the const
keyword.",
"const
has all the awesome features that let
has, with the added bonus that variables declared using const
are read-only. They are a constant value, which means that once a variable is assigned with const
, it cannot be reassigned.",
"
\"use strict\"", - "As you can see, trying to reassign a variable declared with
const FAV_PET = \"Cats\";
FAV_PET = \"Dogs\"; // returns error
const
will throw an error. You should always name variables you don't want to reassign using the const
keyword. This helps when you accidentally attempt to reassign a variable that is meant to stay constant. A common practice is to name your constants in all upper-cases and with an underscore to separate words (e.g. EXAMPLE_VARIABLE
).",
+ "As you can see, trying to reassign a variable declared with const
will throw an error. You should always name variables you don't want to reassign using the const
keyword. This helps when you accidentally attempt to reassign a variable that is meant to stay constant. A common practice when naming constants is to use all uppercase letters, with words separated by an underscore.",
"let
or const
. Use let
when you want the variable to change, and const
when you want the variable to remain constant. Also, rename variables declared with const
to conform to common practices, meaning constants should be in all caps"
+ "Change the code so that all variables are declared using let
or const
. Use let
when you want the variable to change, and const
when you want the variable to remain constant. Also, rename variables declared with const
to conform to common practices, meaning constants should be in all caps."
],
"tests": [
{
- "text": "var
does not exist in code.",
- "testString": "getUserInput => assert(!getUserInput('index').match(/var/g),'var
does not exist in code.');"
+ "text": "var
does not exist in your code.",
+ "testString": "getUserInput => assert(!getUserInput('index').match(/var/g),'var
does not exist in your code.');"
},
{
- "text": "SENTENCE
should be a constant variable (by using const
).",
- "testString": "getUserInput => assert(getUserInput('index').match(/(const SENTENCE)/g), 'SENTENCE
should be a constant variable (by using const
).');"
+ "text": "SENTENCE
should be a constant variable declared with const
.",
+ "testString": "getUserInput => assert(getUserInput('index').match(/(const SENTENCE)/g), 'SENTENCE
should be a constant variable declared with const
.');"
},
{
- "text": "i
should be a variable only defined within the for loop scope (by usinglet
).",
- "testString": "getUserInput => assert(getUserInput('index').match(/(let i)/g), 'i
should be a variable only defined within the for loop scope (by usinglet
).');"
+ "text": "i
should be declared with let
.",
+ "testString": "getUserInput => assert(getUserInput('index').match(/(let i)/g), 'i
should be declared with let
.');"
+ },
+ {
+ "text": "console.log
should be changed to print the SENTENCE
variable.",
+ "testString": "getUserInput => assert(getUserInput('index').match(/console.log/(/s*?SENTENCE/s*?/)/s*?;/g), 'console.log
should be adjusted to print the variable SENTENCE
.');"
}
],
"releasedOn": "Feb 17, 2017",
@@ -161,7 +165,7 @@
"",
" var sentence = str + \" is cool!\";",
" for(var i = 0; i < str.length; i+=2) {",
- " console.log(str);",
+ " console.log(sentence);",
" }",
"",
" // change code above this line",