구조분해할당을 응용하여 array의 요소를 swap해주는 간단한 함수이다.
const swapArrayItemsByIdx = (arr: any[], index1: number, index2: number) => { [arr[index1], arr[index2]] = [arr[index2], arr[index1]]; };