const s = [5, 7, 2]; function editInPlace() { s.unshift(s[2]); s.pop(); return s; } console.log(editInPlace());