function MoveElementToEnd(arr, index) {
arr.splice(arr.length - 1, 0, arr.splice(index, 1)[0]);
return arr;
}
let arr = [3, 8, 20, 80, 14, 19, 7];
const index = 2;
arr = MoveElementToEnd(arr, index);
console.log(arr);
/*
run:
[3, 8, 80, 14, 19, 7, 20]
*/