"use strict";
const s = [5, 7, 2];
// change code below this line
s[0] = 2;
s[1] = 5;
s[2] = 7;
// change code above this line
console.log(s);
Result: Do not replace const keyword. WRONG s is declared with const. WRONG Do not change the original array declaration. WRONG s should be equal to [2, 5, 7]. GOOD
Seems to be working now. You and I have the same code and it works. Did you remember to add the editInPlace(); at the bottom of your code? Seem like you’re missing this part.
function editInPlace() {
"use strict";
// change code below this line
s[0] = 2;
s[1] = 5;
s[2] = 7;
console.log(s);
// change code above this line
}
editInPlace();```
That’s the method I used as well. First I did it by assigning each array the new value; but then I noticed that they were the same numbers, just the first number was now the last item, and the other two moved down. I first did this incorrectly, by doing s.push(s.shift());.