@@ -116,9 +116,9 @@ function assignWithRandomPriority_(
116116 } , { } ) ;
117117 for ( let i = 0 ; i < numActivitiesPerPerson ; ++ i ) {
118118 const randomizedAttendees = shuffleArray_ ( attendees ) ;
119- randomizedAttendees . forEach ( ( attendee ) => {
119+ for ( const attendee of randomizedAttendees ) {
120120 makeChoice_ ( attendee , activitiesById ) ;
121- } ) ;
121+ }
122122 }
123123}
124124
@@ -201,7 +201,6 @@ function writeAttendeeAssignments_(ss, attendees) {
201201function writeActivityRosters_ ( ss , activities ) {
202202 const sheet = findOrCreateSheetByName_ ( ss , "Activity rosters" ) ;
203203 sheet . clear ( ) ;
204- const rows = [ ] ;
205204 let rows = activities . map ( ( activity ) => {
206205 const roster = activity . roster . map ( ( attendee ) => attendee . email ) ;
207206 return [ activity . description ] . concat ( roster ) ;
@@ -330,9 +329,9 @@ function generateTestData_() {
330329
331330 const activities = loadActivitySchedule_ ( ss ) ;
332331 const choices = fillArray_ ( [ ] , activities . length , "" ) ;
333- range_ ( 1 , 5 ) . forEach ( ( value ) => {
332+ for ( const value of range_ ( 1 , 5 ) ) {
334333 choices [ value ] = toOrdinal_ ( value ) ;
335- } ) ;
334+ }
336335
337336 const rows = range_ ( 1 , NUM_TEST_USERS ) . map ( ( value ) => {
338337 const randomizedChoices = shuffleArray_ ( choices ) ;
@@ -457,7 +456,8 @@ function range_(start, end) {
457456 const arr = [ start ] ;
458457 let i = start ;
459458 while ( i < end ) {
460- arr . push ( ( i += 1 ) ) ;
459+ i += 1 ;
460+ arr . push ( i ) ;
461461 }
462462 return arr ;
463463}
@@ -473,12 +473,12 @@ function range_(start, end) {
473473 */
474474function transpose_ ( arr , fillValue ) {
475475 const transposed = [ ] ;
476- arr . forEach ( ( row , rowIndex ) => {
477- row . forEach ( ( col , colIndex ) => {
476+ for ( const [ rowIndex , row ] of arr . entries ( ) ) {
477+ for ( const [ colIndex , col ] of row . entries ( ) ) {
478478 transposed [ colIndex ] =
479479 transposed [ colIndex ] || fillArray_ ( [ ] , arr . length , fillValue ) ;
480480 transposed [ colIndex ] [ rowIndex ] = row [ colIndex ] ;
481- } ) ;
482- } ) ;
481+ }
482+ }
483483 return transposed ;
484484}
0 commit comments