File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -130,4 +130,22 @@ console.log(`ticket Price Total: $ ${ticketPriceTotal}`);
130130 \n 3XL = ${ printing3XShirts . length } ` ) ;
131131// Problem 2
132132
133- // Problem 3
133+
134+
135+ // create a new array of object with unique sizes to be printed
136+
137+
138+ var printSizes = [ ] ;
139+ runners . filter ( function ( item ) {
140+ var i = printSizes . findIndex ( x => x . shirt_size == item . shirt_size ) ;
141+ if ( i <= - 1 ) {
142+ printSizes . push ( { shirt_size : item . shirt_size } ) ;
143+ }
144+ return null ;
145+ } ) ;
146+ console . log ( printSizes ) ;
147+
148+ // Problem 3
149+
150+ // here we will combine the problem 1 & problem 2 to produce an elegant programmatic solution to
151+ // help the race director order the appropriate tShirts in an exact quantity
You can’t perform that action at this time.
0 commit comments