Mutate an Array Declared with const

Anonymous
plain_text
01/07/2023 9:53 AM
168 B
20
Indexable
const s = [5, 7, 2];
function editInPlace() {
  s.unshift(s[2]); 
  s.pop();
  return s;
}
console.log(editInPlace());
Editor is loading...