code: function arrayMove(x, from, to) {
    const y = x.slice();
    y.splice((to < 0 ? y.length + to : to), 0, y.splice(from, 1)[0]);
    return y;
  }
docs: src: https://github.com/sindresorhus/array-move/blob/master/index.js