Is there a better approach to my code below. my code is working, but I'm just wondering if there is a better way to it. I have an array and i want to return the last item in this array to the first spot.
const replce = arr => {
let n = arr.pop();
arr.splice(0, 0, n);
return arr;
};
console.log(replce(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']));