Mutate an Array Declared with const

mail@pastecode.io avatar
unknown
plain_text
2 years ago
124 B
3
Indexable
Never
const s = [5, 7, 2];
function editInPlace() {
  s.unshift(s[2]); 
  s.pop();
  return s;
}
console.log(editInPlace());