Nodejs

No description

fork
loading
Files
  • index.js
  • arrays.js
index.js
1
2
3
4
5
6
7
/* Rotate the array */
let arr = [1,2,3,4,5];
let rotateIndex =2;
let items  =arr.splice(rotateIndex+1);
console.log(items)

console.log(items.concat(arr))
node v10.16.0