Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why do minimized javascript scripts use the same variable names in the same order

A lot of functions from different sources seem to use a subset of "e t n r o i" for varible and parameter names. Most of Jquery's functions use this. Many polyfill scripts use these parameters. I have seen other scripts use these. Why use these specific variable names in this specific order? Are these scripts being minimized using the same program? Is there some type of advantage to using this?

like image 505
Nateguana Avatar asked May 29 '26 13:05

Nateguana


1 Answers

This is done for zipping reasons (gzip). These characters are very common in the English language, and therefore will also be present more frequently in variables or values that cannot be minified. Which will make the gzipped version possibly smaller than if they were to use z q x j

like image 88
Poul Kruijt Avatar answered Jun 01 '26 03:06

Poul Kruijt



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!