In Javascript, it is said that functions are executed using the scope that was in effect when the function was defined. It has nothing to do with the scope in effect when the function is called.
What exactly does it mean? Could someone please explain with simple examples.