mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-16 21:06:35 +08:00
Better use of "let" (#32800)
This commit is contained in:
parent
3055dfc912
commit
a415c2055b
@ -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];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user