Course · Section 9: Data Structures, Modern Operators and Strings · Lecture 111: The Spread Operator (...)
Implement `updateAt(list, index, value)` returning a new array with the element at `index` replaced by `value`.
+ 1 hidden test run on Submit.
map returns a new array. At the matching index you return value; at every other position you return the original element, so only one slot changes while the rest are preserved.
Run your code to see results.