We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents af9de0f + fac2d1f commit 5e0e571Copy full SHA for 5e0e571
src/algorithms/sorting/selection-sort/SelectionSort.js
@@ -23,9 +23,7 @@ export default class SelectionSort extends Sort {
23
24
// If new minimum element has been found then swap it with current i-th element.
25
if (minIndex !== i) {
26
- const tmp = array[i];
27
- array[i] = array[minIndex];
28
- array[minIndex] = tmp;
+ [array[i], array[minIndex]] = [array[minIndex], array[i]];
29
}
30
31
0 commit comments