DEV Community

Discussion on: Applying To Facebook

Collapse
 
sunflower profile image
sunflowerseed

using IIFE, for example, is to enclosure everything in the local scope and let nothing affects the global scope.

One cheesy "expert" called that a "closure", but it is not. It merely is due to the local scope. I wrote to the author saying C could have done the same, and C doesn't have closure but just local scope, and his helper wrote back, "C may be able to do that, but JavaScript we are using closure." How assertive and incorrect. The author then later instructed his helper to "JUST CHANGE it to local scope", also assertively, and that helper just obliged.