Hello my fellow JavaScript developers π Back in my first job I quickly realized that the FreeCodeCamp front end course I had finished wasn't nearly enough to deal with the hardships of creating scalable and maintainable D3 chart templates. A fact th...

Markdown supported Β· ββ΅ to post
Nice article, good visualizations.
But your explanation of closures is not correct and it happens a lot. You are describing lexical scoping as far as I remember.
A closure "closes" the function.
function a() {
let me = 0;
function b(){
me = 1;
}
return b;
}
let fA = a(); // function is still "in the memory"
fA(); // now it is getting removed "from the memory"
The final execution of b() by calling fA() closes a(). So the name isn't even that bad.
Golden Azubuike
Web content developer
Educative and cool