| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3e0ac74 commit 488b7a4
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ export default class BubbleSort extends Sort { | |||
| 5 | 5 | // Flag that holds info about whether the swap has occur or not. | |
| 6 | 6 | let swapped = false; | |
| 7 | 7 | // Clone original array to prevent its modification. | |
| 8 | - const array = originalArray.slice(0); | ||
| 8 | + const array = [...originalArray]; | ||
| 9 | 9 | ||
| 10 | 10 | for (let i = 0; i < array.length; i += 1) { | |
| 11 | 11 | swapped = false; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments