Using
myvar==undefined (or any variable, which is undefined)
is about 30% faster than
typeof myvar=="undefined"

About window, I don't know if that would speed up accessing it but
being a local variable it may be a bit faster. I think the main
purpose is to allow some minifiers to replace local variables with a
shorter one.

On Jan 7, 2:17 pm, Jinpu Hu <huji...@gmail.com> wrote:
> I see "var window = this" from latest svn code
>
> I use firebug debugger it.
>
> info:"Exception: redeclaration of const window"
>
> but in core.js
>
> var
>         // Will speed up references to window, and allows munging its name.
>         window = this,
>         // Will speed up references to undefined, and allows munging its
> name.
>         undefined,
>         // Map over jQuery in case of overwrite
>         _jQuery = window.jQuery,
>         // Map over the $ in case of overwrite
>         _$ = window.$,
>
> i want to know what does "speed up references to window"  mean?

Reply via email to