Feedback Request: Closure Analogy Inspired by Your Tutorial
Hi Tapas,
I’m a new software developer, and I’ve been following your tutorials to deepen my understanding of JavaScript concepts. Your video/code on JavaScript Function closures was incredibly insightful, and it made a challenging topic much easier for me to grasp. Thank you for sharing such valuable content!
As I was learning, I came up with an analogy to explain closures in a way that I think others (especially beginners like me) might find relatable. I’d love to hear your thoughts on whether this analogy accurately captures the essence of closures in JavaScript or if there’s something I can improve.
Here’s the analogy: https://github.com/Rasheesays/JS-Function-Beginner-To-Advance/commit/5bae96d96f83bf4f9422a7af376a424b2318031c
The analogy compares closures to a father-child relationship, where:
The father represents the outer function, holding possessions (parameters/variables). The child represents the inner function, which has access to the father’s possessions while also having its own unique qualities. When the father "passes away" (function execution ends), the child still retains access to the father’s possessions via a “Will” (closure). This is just a summary, but the full analogy is in my code/repo linked above.
It would mean a lot to me if you could take a look and share your opinion. Does this analogy work well to describe JavaScript closures, or are there areas where I’ve misunderstood or could refine it further?
Thanks so much for taking the time to review this, and I truly appreciate the knowledge you share!
Best regards, Abdulrasheed.
Analogy is great!
Thanks for thinking aloud and learning deep. Keep going.
I looked into the code, all god.. except one line. Why did you make this assignment here? https://github.com/Rasheesays/JS-Function-Beginner-To-Advance/commit/5bae96d96f83bf4f9422a7af376a424b2318031c#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R130
Thanks,
- Tapas Adhikary Teacher, @tapaScript https://www.youtube.com/tapasadhikary Co-Founder, CreoWis Technologies https://creowis.com Connect: Know Me https://tapasadhikary.com - X/Twitter https://twitter.com/tapasadhikary - LinkedIn https://www.linkedin.com/in/tapasadhikary/
On Sun, Dec 22, 2024 at 7:35 PM Abdulrasheed Ogirima < @.***> wrote:
Hi Tapas,
I’m a new software developer, and I’ve been following your tutorials to deepen my understanding of JavaScript concepts. Your video/code on JavaScript Function closures was incredibly insightful, and it made a challenging topic much easier for me to grasp. Thank you for sharing such valuable content!
As I was learning, I came up with an analogy to explain closures in a way that I think others (especially beginners like me) might find relatable. I’d love to hear your thoughts on whether this analogy accurately captures the essence of closures in JavaScript or if there’s something I can improve.
Here’s the analogy: @.*** https://github.com/Rasheesays/JS-Function-Beginner-To-Advance/commit/5bae96d96f83bf4f9422a7af376a424b2318031c
The analogy compares closures to a father-child relationship, where:
The father represents the outer function, holding possessions (parameters/variables). The child represents the inner function, which has access to the father’s possessions while also having its own unique qualities. When the father "passes away" (function execution ends), the child still retains access to the father’s possessions via a “Will” (closure). This is just a summary, but the full analogy is in my code/repo linked above.
It would mean a lot to me if you could take a look and share your opinion. Does this analogy work well to describe JavaScript closures, or are there areas where I’ve misunderstood or could refine it further?
Thanks so much for taking the time to review this, and I truly appreciate the knowledge you share!
Best regards, Abdulrasheed.
— Reply to this email directly, view it on GitHub https://github.com/atapas/youtube/issues/61, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3W74JCZKREEHA6O6Q7PZL2G3BMDAVCNFSM6AAAAABUBVXR7GVHI2DSMVQWIX3LMV43ASLTON2WKOZSG42TINRXGUZTCNI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Analogy is great! Thanks for thinking aloud and learning deep. Keep going. I looked into the code, all good.. except one line. Why did you make this assignment here? Rasheesays/JS-Function-Beginner-To-Advance@5bae96d#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346R130
Hey Tapas, great sighting! The variable Fatheroldage was a leftover from an earlier thought I had during the coding process, which unfortunately I forgot to remove. I’ve now updated the code to eliminate it, and here’s the updated version:
(https://github.com/Rasheesays/JS-Function-Beginner-To-Advance/commit/99120c2ded261774cfb7338e7c3955fdf22410a9#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346L135)