Photo by Joshua Reddekopp on Unsplash

In JavaScript, closure refers to a function “remembering” the variables outside of it.

This behavior is exclusive to returned functions. Let’s have a look:

function whatDay(weekDay) {
return function saveDay() {
console.log(weekDay);
}
}

let today = whatDay("Saturday")

today() // Saturday
  1. is a function that returns a function .
  2. We assign a function call of with as the argument for 's parameter.
  3. now closes over the outer variable (whose value is ).
  4. is now permanently linked to the variable, even after it has "expired" in the outer function after its life…

Photo by Alexandra on Unsplash

Often, we don’t say what we think; more often, we don’t write what we believe. The medium is the message.

Sometimes, however, we take the time to think about things, only to find ourselves ensnared by semantics. In the same vein, the minds of many people appear to be possessed, or otherwise entangled, by ideas and thoughts which appear meaningless when we think about them.

We, as a species, are in the habit of inventing artificial constructs, realizations of concepts, to name things, thereby divorcing them from their natural nameless forms. To name something is to guillotine that thing. Our…

Nikolay Rademacher

writer of fiction and miscellany

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store