From 9995ca0c824536431903cc851c4701278c5608fe Mon Sep 17 00:00:00 2001 From: aecepoglu Date: Wed, 23 Aug 2023 17:08:26 +0100 Subject: [PATCH] Update 19_day_closures.md make 2nd closure example relevant to the topic --- 19_Day_Closures/19_day_closures.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/19_Day_Closures/19_day_closures.md b/19_Day_Closures/19_day_closures.md index 653c185d..e37d328c 100644 --- a/19_Day_Closures/19_day_closures.md +++ b/19_Day_Closures/19_day_closures.md @@ -68,19 +68,27 @@ function outerFunction() { } return { - plusOne:plusOne(), - minusOne:minusOne() + plusOne:plusOne, + minusOne:minusOne } } const innerFuncs = outerFunction() -console.log(innerFuncs.plusOne) -console.log(innerFuncs.minusOne) +console.log(innerFuncs.plusOne()) +console.log(innerFuncs.plusOne()) +console.log(innerFuncs.plusOne()) +console.log(innerFuncs.minusOne()) +console.log(innerFuncs.minusOne()) +console.log(innerFuncs.plusOne()) ``` ```sh 1 -0 +2 +3 +2 +1 +2 ``` 🌕 You are making progress. Maintain your momentum, keep the good work. Now do some exercises for your brain and for your muscle. @@ -101,4 +109,4 @@ console.log(innerFuncs.minusOne) 🎉 CONGRATULATIONS ! 🎉 -[<< Day 18](../18_Day_Promises/18_day_promises.md) | [Day 20 >>](../20_Day_Writing_clean_codes/20_day_writing_clean_codes.md) \ No newline at end of file +[<< Day 18](../18_Day_Promises/18_day_promises.md) | [Day 20 >>](../20_Day_Writing_clean_codes/20_day_writing_clean_codes.md)