const s = [5, 7, 2];
function editInPlace() {
'use strict';
// Only change code below this line
s = [2, 5, 7];
// Using s = [2, 5, 7] would be invalid
// Only change code above this line
}
editInPlace();
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36.
Take a look at the example provided in the challenge instructions:
"use strict";
const s = [5, 6, 7];
s = [1, 2, 3]; // throws error, trying to assign a const
s[2] = 45; // works just as it would with an array declared with var or let
console.log(s); // returns [5, 6, 45]
Do you see the line that successfully changes one of the values in the array?
you can’t do this. it literally says that s = [2, 5, 7]; will be invalid. you need to change every place in array separately as they did in the example using s[2] = 45 (they changed the 3d element there, so you can use the same process and change all the numbers in your array)