From b61d6020a1f70021252b3f72a24abad2249e6737 Mon Sep 17 00:00:00 2001 From: marsonya Date: Sun, 24 Jan 2021 23:30:20 +0530 Subject: [PATCH] Replaced use of var with const | Bubble Sort --- Sorts/BubbleSort.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sorts/BubbleSort.js b/Sorts/BubbleSort.js index e7b8572c9..390ef7912 100644 --- a/Sorts/BubbleSort.js +++ b/Sorts/BubbleSort.js @@ -53,7 +53,7 @@ function bubbleSort (items) { /* * Implementation of 2 for loops method */ -var array1 = [5, 6, 7, 8, 1, 2, 12, 14] +const array1 = [5, 6, 7, 8, 1, 2, 12, 14] // Before Sort console.log('\n- Before Sort | Implementation using 2 for loops -') console.log(array1) @@ -84,7 +84,7 @@ function alternativeBubbleSort (arr) { /* * Implementation of a while loop and a for loop method */ -var array2 = [5, 6, 7, 8, 1, 2, 12, 14] +const array2 = [5, 6, 7, 8, 1, 2, 12, 14] // Before Sort console.log('\n- Before Sort | Implementation using a while loop and a for loop -') console.log(array2)