File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed
Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ numbers[-10] = 'Value3';
66numbers . field1 = 'Value1' ;
77numbers [ 5 ] = 20 ;
88
9- for ( const i of numbers ) {
10- const value = numbers [ i ] ;
11- console . log ( i , typeof i , value ) ;
9+ for ( const value of numbers ) {
10+ console . log ( value , typeof value ) ;
1211}
Original file line number Diff line number Diff line change 33let i = 0 ;
44while ( i < 10 ) {
55 i ++ ;
6- console . log ( 'Hello' ) ;
6+ console . log ( 'Hello' , i ) ;
77 if ( i === 5 ) continue ;
88 console . log ( 'World' ) ;
99}
Original file line number Diff line number Diff line change @@ -15,10 +15,8 @@ const res = matrix
1515
1616console . log ( res ) ;
1717
18- for ( const i in matrix ) {
19- const row = matrix [ i ] ;
20- for ( const j in row ) {
21- const col = row [ j ] ;
22- console . log ( i , j , col ) ;
18+ for ( const row of matrix ) {
19+ for ( const item of row ) {
20+ console . log ( item ) ;
2321 }
2422}
You can’t perform that action at this time.
0 commit comments