You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In cases where we manipulate a number using ++ or -- after its use, it may be possible to use it inline, reducing a few bytes (~2 bytes per use). Currently, this feature works outside of looping.
Describe the feature
In cases where we manipulate a number using
++
or--
after its use, it may be possible to use it inline, reducing a few bytes (~2 bytes per use). Currently, this feature works outside of looping.For instance:
Will be (prettified):
Could be:
So
n
will be post-incremented, but it will return the old value to access the index ata
anyway.It is possible to think of other variations to this rule, although most cases will be simple like the first example.
Note: currently Terser does not support this kind of optimization.
Babel plugin or link to the feature description
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: