6 ms·
Another reason to use `void 0` is that "void 0" takes only 6 characters while "undefined" takes 9, saving some bandwidth. It is common practice for JavaScript m
by kerneloops 4y ago
Another reason to use `void 0` is that "void 0" takes only 6 characters while "undefined" takes 9, saving some bandwidth. It is common practice for JavaScript minifiers to use this substitution.
- marginalia_nu 4y agoGiven it will be gzip-compressed in transport, does this really save a meaningful amount of bandwidth?
- draw_down 4y agoIt’s really more that there is no reason not to do it. Void is marginally safer as well as shorter, so any minifier/transpile step etc will make this substitution.