File tree Expand file tree Collapse file tree 3 files changed +9
-12
lines changed
Expand file tree Collapse file tree 3 files changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ console.log('Example 2');
1818console . log ( 'Example 3' ) ;
1919
2020{
21- let i = 0 ;
22- for ( ; i < 3 ; ) {
21+ for ( let i = 0 ; i < 3 ; ) {
2322 console . log ( i ++ ) ;
2423 }
2524}
Original file line number Diff line number Diff line change @@ -15,11 +15,10 @@ const res = matrix
1515
1616console . log ( res ) ;
1717
18- let i , j , row , col ;
19- for ( i in matrix ) {
20- row = matrix [ i ] ;
21- for ( j in row ) {
22- col = row [ j ] ;
18+ for ( const i in matrix ) {
19+ const row = matrix [ i ] ;
20+ for ( const j in row ) {
21+ const col = row [ j ] ;
2322 console . log ( i , j , col ) ;
2423 }
2524}
Original file line number Diff line number Diff line change @@ -7,11 +7,10 @@ const matrix = [
77 [ - 6 , 4 , 8 , 2 , 0 ] ,
88] ;
99
10- let i , j , row , col ;
11- for ( i in matrix ) {
12- row = matrix [ i ] ;
13- for ( j in row ) {
14- col = row [ j ] ;
10+ for ( const i in matrix ) {
11+ const row = matrix [ i ] ;
12+ for ( const j in row ) {
13+ const col = row [ j ] ;
1514 console . log ( i , j , col ) ;
1615 }
1716}
You can’t perform that action at this time.
0 commit comments