Javascript solution
\nvar rotate = function (nums, k) {\n    const len = nums.length\n    k = (k % len)\n    \n    let end = nums.splice(len - k)\n\n    nums.splice(0,0,...end)\n};
```\nvar rotate = function (nums, k) {\n    const len = nums.length\n    k = (k % len)\n    \n    let end = nums.splice(len - k)\n\n    nums.splice(0,0,...end)\n};\n```\n\nRuntime: 104 ms, faster than 87.37% of JavaScript online submissions for Rotate Array.\nMemory Usage: 50.7 MB, less than 43.86% of JavaScript online submissions for Rotate Array.
['JavaScript']