const s = [5, 7, 2];
function editInPlace(s) {
// Only change code below this line
"use strict";
s[0] = 2;
s[1] = 5;
s[2] = 7;
// Using s = [2, 5, 7] would be invalid
// Only change code above this line
}
editInPlace();```
Adding s as an argument fundamentally changes how this function works. Without the argument, this function uses the global variable s. With the argument, the function works for any array passed into the function. Very different behavior.
If you want to use an argument, then yes you have to add an argument. But we aren’t using an argument here. We’re directly referencing the global variable.
It will pass if you add both the parameter and the argument.
Summary
const s = [5, 7, 2];
function editInPlace(s) {
// Only change code below this line
"use strict";
s[0] = 2;
s[1] = 5;
s[2] = 7;
// Using s = [2, 5, 7] would be invalid
// Only change code above this line
}
editInPlace(s);
But as said, you should try not to make changes you are not asked to make. Stick to the requirements as outlined in the challenges.