Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e0ac74 commit 488b7a4Copy full SHA for 488b7a4
src/algorithms/sorting/bubble-sort/BubbleSort.js
@@ -5,7 +5,7 @@ export default class BubbleSort extends Sort {
5
// Flag that holds info about whether the swap has occur or not.
6
let swapped = false;
7
// Clone original array to prevent its modification.
8
- const array = originalArray.slice(0);
+ const array = [...originalArray];
9
10
for (let i = 0; i < array.length; i += 1) {
11
swapped = false;
0 commit comments