3 ms·
i came to the conclusion that functions === closures. closure/functions close the parents scoped variables in an own scope
by christian_fei 13y ago
i came to the conclusion that functions === closures.
closure/functions close the parents scoped variables in an own scope
- btilly 13y agoThat conclusion is language dependent. When you learn other languages, you'll encounter ones like eLisp and C++ which have equivalents of anonymous functions, without making them closures.
- christian_fei 13y agook. but at least in javascript this mysterious phrase is true, right?
- btilly 13y agoYes. But it is one of a set of mysterious phrases like "pass by value" and "pass by reference" which, if you learn them, will make it much easier to keep multiple languages in your head.