It skips the code needed to search for the area, since global is inside the function.
Change is a performance optimization. Scope in javascript is limited to a functional scope. global in this case is defined within this area, therefore, when the code falls on global[...] , it looks at its immediate volume (inside the function) and immediately finds global . Without this, he will have to move to the closing region, which in this case is the global javascript namespace and will look for the entire region for the window .
T. Stone
source share