We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fad170c commit fac2d1fCopy full SHA for fac2d1f
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