JSFiddle - React, Tailwind, and code Playground

by apasaja

JavaScript

const array = [1, 2, 3, 4, 5];

array.unshift(array.pop());

console.log(array); // [5, 1, 2, 3, 4]