Skip to content

Commit b61d602

Browse files
committed
Replaced use of var with const | Bubble Sort
1 parent bf3d37a commit b61d602

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sorts/BubbleSort.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function bubbleSort (items) {
5353
/*
5454
* Implementation of 2 for loops method
5555
*/
56-
var array1 = [5, 6, 7, 8, 1, 2, 12, 14]
56+
const array1 = [5, 6, 7, 8, 1, 2, 12, 14]
5757
// Before Sort
5858
console.log('\n- Before Sort | Implementation using 2 for loops -')
5959
console.log(array1)
@@ -84,7 +84,7 @@ function alternativeBubbleSort (arr) {
8484
/*
8585
* Implementation of a while loop and a for loop method
8686
*/
87-
var array2 = [5, 6, 7, 8, 1, 2, 12, 14]
87+
const array2 = [5, 6, 7, 8, 1, 2, 12, 14]
8888
// Before Sort
8989
console.log('\n- Before Sort | Implementation using a while loop and a for loop -')
9090
console.log(array2)

0 commit comments

Comments
 (0)