JavaScript ES6 one-liners: rotate an array
const arr = [1,2,3,4,5]; const shift = 2;  // rotate left by n &lt; array length: console.log(`rotate...
Tags: javascript, array, rotate, spread