Tell us what’s happening:
Describe your issue in detail here.
**Your code so far**
const s = [5, 7, 2];
function editInPlace() {
// Only change code below this line
const S = [2, 5, 7];
function editInPlace() {
"use strict";
S[0] = 2;
S[1] = 5;
S[2] = 7;
}
editInPlace();
// 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/90.0.4430.93 Safari/537.36.
You have misunderstood what the challenge wants you to do. You’re not supposed to create a new array S (uppercase), but to change the existing array s (lowercase).
Because it was declared with const, you can’t just reassign it to a new array. Instead you have to change each item by accessing it directly through its index: s[0] , s[1] etc.