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

use void 0 to replace 'undefined' #7

Open
newPromise opened this issue Mar 21, 2018 · 4 comments
Open

use void 0 to replace 'undefined' #7

newPromise opened this issue Mar 21, 2018 · 4 comments

Comments

@newPromise
Copy link

newPromise commented Mar 21, 2018

use void 0 to replace 'undefined' for prevent rewrite.
image

@jonschlinkert
Copy link
Owner

I'll need some help understanding this. Please describe the problem first (be specific).

@newPromise
Copy link
Author

because when under ES5 , especially in IE browser, identifier undefined can be rewrited, like this example:

var undefined = "hello";
console.log(undefined === "hello"); // true

under Chrome browser or use strict mode no question;

because you use strict mode, so it's well;

so sorry~, my English is not well...

@jonschlinkert
Copy link
Owner

want to do a pr?

@anonyco
Copy link

anonyco commented Aug 19, 2019

Please do not do this. It makes the code harder to read and is already done by decent minifiers like closure compiler. If you want smaller code, run the Javascript through a minifier instead of trying to compact the source code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants