From a9d2198aba5493deafb9b5e7c4e7e560068af49a Mon Sep 17 00:00:00 2001 From: Santiago Miranda Date: Fri, 2 Sep 2022 19:01:08 +0200 Subject: [PATCH] Better wording of exercise description (#47431) Update mutate-an-array-declared-with-const.md Fixed unclear part of the exercise description. As cited by user [in the forum](https://forum.freecodecamp.org/t/cannot-understand-the-following-line-in-question/549786/3) --- .../es6/mutate-an-array-declared-with-const.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.md index fd6918ccee3..a00656a24c7 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/es6/mutate-an-array-declared-with-const.md @@ -23,7 +23,7 @@ s[2] = 45; console.log(s); ``` -`s = [1, 2, 3]` will result in an error. The `console.log` will display the value `[5, 6, 45]`. +`s = [1, 2, 3]` will result in an error. After commenting out that line, the `console.log` will display the value `[5, 6, 45]`. As you can see, you can mutate the object `[5, 6, 7]` itself and the variable `s` will still point to the altered array `[5, 6, 45]`. Like all arrays, the array elements in `s` are mutable, but because `const` was used, you cannot use the variable identifier `s` to point to a different array using the assignment operator.