(first, second, array)
| 63 | } |
| 64 | |
| 65 | function swap(first, second, array) { |
| 66 | const temp = array[first]; |
| 67 | array[first] = array[second]; |
| 68 | array[second] = temp; |
| 69 | } |
| 70 | const array = [1, 0, 0, -1, -1, 0, 1, 1]; |
| 71 | const order = [0, 1, -1]; |
| 72 | console.log(threeNumberSort(array, order)); |