Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify script’s footer #1066

Closed
wants to merge 1 commit into from
Closed

Simplify script’s footer #1066

wants to merge 1 commit into from

Commits on Feb 20, 2018

  1. Simplify script’s footer

    1. ‘typeof foo === "undefined"’ is just a convoluted way of writing
       ‘foo === undefined’.  The slight risk of ‘undefined’ being redefined
       (since it’s not a keyword) can be easily averted by using ‘void 0’.
       In the end, ‘typeof foo === "undefined"’ becomes ‘foo === void 0’
       which is shorter and does the same thing.
    
    2. There is really no need to use Function.prototype.call.  Since the
       wrapper function uses it’s ‘this’ variable exactly once, whatever
       function run as call argument does can be moved inside of the wrapper.
    
    This shortens and simplifies script’s footer.
    mina86 committed Feb 20, 2018
    Configuration menu
    Copy the full SHA
    b0524df View commit details
    Browse the repository at this point in the history