JSFiddle - React, Tailwind, and code Playground
by jgarrido
JavaScript
let A = [1, 2, 3, 4];
let K = 4;
for(let i = 0; i < K; i++) {
A.unshift(A.pop());
}
console.log("A", A);
by jgarrido
let A = [1, 2, 3, 4];
let K = 4;
for(let i = 0; i < K; i++) {
A.unshift(A.pop());
}
console.log("A", A);