3 ms·
Defining variables as parameters saves bytes (", x" vs "var x") but shouldn't increase performance. Passing document into the function saves writing "document"
by dave1010uk 15y ago
Defining variables as parameters saves bytes (", x" vs "var x") but shouldn't increase performance. Passing document into the function saves writing "document" twice or doing a "var d = document".
Creating a new script tag with JS lets you get asynchronous script loading for older browsers that don't support the async attribute.
Some other ways to reduce bytes are outlined at https://github.com/jed/140bytes/wiki/Byte-saving-techniques https://github.com/jed/140bytes/wiki/Byte-saving-techniques