Why Does Js Minification Convert 1000 to 1E3?

What is the point to change (int) 1000 to 1E3?

And where does 1E3 come from?

I know just 3bytes vs 4bytes.

3

3 Answers

The whole point of minification is to be able to pass less data over the network but retain the same functionality.

Taken from wikipedia:

Minification (also minimisation or minimization), in computer programming languages and especially JavaScript, is the process of removing all unnecessary characters from source code without changing its functionality. These unnecessary characters usually include white space characters, new line characters, comments, and sometimes block delimiters, which are used to add readability to the code but are not required for it to execute.

As long as the size is smaller the minification is doing its job.

1E3 pretty much means 10 to the power of 3; a shorter way of representing the number 1000.

1

they are the same value, 1E3 is 10 to the third power, or 1000, so the point it so save 25%

2

To be precise: 1e3 stands for 1 * 10^3

Further Examples: 2e2 = 200 and 0.1e2 = 10

See also:

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest