File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,4 +148,9 @@ function lgDonation(donation){
148148
149149
150150// Problem 3
151- //
151+ // Sort alphabetically for the start order.
152+ let company = runners . map ( function ( array ) {
153+ return array . company_name ;
154+ } ) ;
155+
156+ console . log ( company . sort ( ) ) ;
Original file line number Diff line number Diff line change 22// Write a simple closure of your own creation. Keep it simple!
33
44
5+
56/* STRETCH PROBLEMS, Do not attempt until you have completed all previous tasks for today's project files */
67
78
@@ -19,3 +20,14 @@ const counterFactory = () => {
1920 // `increment` should increment a counter variable in closure scope and return it.
2021 // `decrement` should decrement the counter variable and return it.
2122} ;
23+
24+ function showName ( firstName , lastName ) {
25+ var nameIntro = "Your name is " ;
26+ // this inner function has access to the outer function's variables, including the parameter
27+ function makeFullName ( ) {
28+ return nameIntro + firstName + " " + lastName ;
29+ }
30+ return makeFullName ( ) ;
31+ }
32+
33+ showName ( "Michael" , "Jackson" ) ; // Your name is Michael Jackson
Original file line number Diff line number Diff line change 77
88 < title > JS II</ title >
99
10- < script src ="array-methods.js "> </ script >
10+ <!-- < script src="array-methods.js"></script> -- >
1111 <!-- <script src="callbacks.js"></script> -->
12- <!-- < script src="closure.js"></script> -- >
12+ < script src ="closure.js "> </ script >
1313 <!-- <script src="stretch-function-conversion.js"></script> -->
1414</ head >
1515
You can’t perform that action at this time.
0 commit comments