File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,11 +38,11 @@ function eatLunch(cannedFood) {
3838 . then ( contents => {
3939 console . log ( 'Opened can: ' + contents ) ;
4040 console . log ( 'Warming up: ' + contents ) ;
41- return warmUp ( contents )
42- . then ( hotFood => {
43- console . log ( 'Warmed up: ' + hotFood ) ;
44- return eat ( hotFood ) ;
45- } ) ;
41+ return warmUp ( contents ) ;
42+ } )
43+ . then ( hotFood => {
44+ console . log ( 'Warmed up: ' + hotFood ) ;
45+ return eat ( hotFood ) ;
4646 } ) ;
4747}
4848
Original file line number Diff line number Diff line change 1- # Functions, callbacks, promise and async/await
1+ # Functions, callbacks, promises and async/await
22
33## Why use functions?
44
@@ -286,10 +286,10 @@ Our `eatLunch()` and `main()` functions can now be rewritten as follows (`consol
286286function eatLunch (cannedFood ) {
287287 return openCan (cannedFood)
288288 .then (contents => {
289- return warmUp (contents)
290- . then ( hotFood => { console . log ( ' Warmed up: ' + hotFood);
291- return eat (hotFood);
292- } );
289+ return warmUp (contents);
290+ })
291+ . then (hotFood => {
292+ return eat (hotFood );
293293 });
294294}
295295
You can’t perform that action at this time.
0 commit comments