0%

函数表现

1
2
3
4
function arrayMove<T>(array: T[], oldIndex: number, newIndex: number): T[] {
[array[oldIndex], array[newIndex]] = [array[newIndex], array[oldIndex]];
return array;
}