Better use of "let" (#32800)

This commit is contained in:
King Josaphat Chewa
2019-03-26 04:44:06 +01:00
committed by Randell Dawson
parent 3055dfc912
commit a415c2055b

View File

@ -55,11 +55,11 @@ Now, the array is already sorted, but our algorithm does not know if it is compl
### Example in JavaScript
```js
let arr = [1, 4, 7, 45, 7,43, 44, 25, 6, 4, 6, 9];
let sorted = false
let arr = [1, 4, 7, 45, 7,43, 44, 25, 6, 4, 6, 9],
sorted = false;
while(!sorted) {
sorted = true
sorted = true;
for(var i=0; i < arr.length; i++) {
if(arr[i] < arr[i-1]) {
let temp = arr[i];