8000
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 044441e commit 5d12638Copy full SHA for 5d12638
src/algorithms/sorting/bubble-sort/BubbleSort.js
@@ -19,9 +19,7 @@ export default class BubbleSort extends Sort {
19
20
// Swap elements if they are in wrong order.
21
if (this.comparator.lessThan(array[j + 1], array[j])) {
22
- const tmp = array[j + 1];
23
- array[j + 1] = array[j];
24
- array[j] = tmp;
+ [array[j], array[j + 1]] = [array[j + 1], array[j]];
25
26
// Register the swap.
27
swapped = true;
0 commit comments