Arrays: Left Rotation

  • + 4 comments

    One line of JS, no looping:

    console.log(a.concat(a.splice(0,k).join(' ')));