DEV Community

Cover image for A simple example I use to remember what a closure is

A simple example I use to remember what a closure is

Reuben George Thomas on August 13, 2020

You will probably get asked what a closure is at some point in your web dev career, possibly at an interview, and it's one of those things that can...
Collapse
 
catalinradoi profile image
CatalinRadoi •

Thanks! Thought closure meant when you tell your ex not to call you ever again :P

Collapse
 
jackherizsmith profile image
Jack •

In JS, closure is still having your ex's number in your phone ;)

Collapse
 
reubengt profile image
Reuben George Thomas •

😅this works too I guess

Collapse
 
akhilarjun profile image
Akhil Arjun •

That is as neat as someone can explain closures. Good job bro 🕺👾

Collapse
 
tomaszwagner1 profile image
TomW •

nice article bud!

Collapse
 
reubengt profile image
Reuben George Thomas •

Thanks Tom!

Collapse
 
hannahgooding profile image
Hannah Gooding •

So clearly explained Reuben!

Collapse
 
reubengt profile image
Reuben George Thomas •

Thanks! Here's to more posting✌️

Collapse
 
sharozijaz profile image
Sharoz Ijaz •

Thanks for Explaining me this Hard Topic.

Collapse
 
reubengt profile image
Reuben George Thomas •

glad it helped!!

Collapse
 
thomasferro profile image
Thomas Ferro •

Great memory refresh!

I would, however, consider using a real-world example in addition to the one you used, since this concept can feel a little abstract.