From 8397129aaa1479e42508123ee26815440927e0ba Mon Sep 17 00:00:00 2001 From: Bill Cheng <71155598+billc-dev@users.noreply.github.com> Date: Sun, 5 Jun 2022 23:51:36 +0800 Subject: [PATCH] fix(curriculum): Add test output to not change strings assigned to variables (#46353) --- ...eclare-a-read-only-variable-with-the-const-keyword.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/declare-a-read-only-variable-with-the-const-keyword.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/declare-a-read-only-variable-with-the-const-keyword.md index a6ad0552e9a..dd1744e804c 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/declare-a-read-only-variable-with-the-const-keyword.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/declare-a-read-only-variable-with-the-const-keyword.md @@ -25,7 +25,7 @@ You should always name variables you don't want to reassign using the `const` ke # --instructions-- -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. +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. Do not change the strings assigned to the variables. # --hints-- @@ -45,10 +45,15 @@ assert.notMatch(code, /(fCC)/); `FCC` should be a constant variable declared with `const`. ```js -assert.equal(FCC, 'freeCodeCamp'); assert.match(code, /const\s+FCC/); ``` +The string assigned to `FCC` should not be changed. + +```js +assert.equal(FCC, 'freeCodeCamp'); +``` + `fact` should be declared with `let`. ```js