function moveElement(arr, currentIndex, newIndex) {
if (currentIndex === newIndex) {
return arr;
}
const elementToMove = arr.splice(currentIndex, 1)[0];
arr.splice(newIndex, 0, elementToMove);
return arr;
}
function moveElement(arr, currentIndex, newIndex) {
if (currentIndex === newIndex) {
return arr;
}
const elementToMove = arr.splice(currentIndex, 1)[0];
arr.splice(newIndex, 0, elementToMove);
return arr;
}