Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7055805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:47:33+00:00 2026-05-28T03:47:33+00:00

I always wondered why js compressors don’t do this. Let’s say I have a

  • 0

I always wondered why js compressors don’t do this. Let’s say I have a minified script like this:

(function($){var a=$("a");1<a.length&&10>a.length?alert(a.length):alert($("p").length)})(jQuery);

Why doesn’t it compile to something like this:

(function($,L){var a=$("a");1<a[L]&&10>a[L]?alert(a[L]):alert($("p")[L])})(jQuery,'length');

Meaning changing every occurrence of a .property with a [minified key] and pass a string and arg receiver to the iife (basically what I did above with the .length)

Imagine how much more this would minify jQuery with 159 .length, 62 .each, 15 .appendChild etc. Just the .lengths alone would save over 600 bytes!

Also using the example above why does it waste space on a var keyword when you can reserve a space in that functions scope by declaring another parameter:

(function($,L,a){a=$("a");1<a[L]&&10>a[L]?alert(a[L]):alert($("p")[L])})(jQuery,'length');

Also while I have you here, why not put the entire jQuery into an eval and save on another 572 function keywords (4.5k)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:47:34+00:00Added an answer on May 28, 2026 at 3:47 am

    I would imagine that it doesn’t want to assume that you want the expense of a variable lookup in addition to the property lookup.

    If you use Closure Compiler, it will actually undo those types of references if you do it manually.

    Ultimately, if you gzip, I don’t think those obfuscations add up to much. I wouldn’t be surprised if in some cases it actually makes your gzipped version larger.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have always wondered how I should do this. Lets say I have a
one thing that i always wondered, if i have a method like this: String
I've always wondered... so you have a code like this: $('#click-me'); and you attach
i have always wondered how to handle Files in applications. Say we have an
I'v always wondered this. In a game like GTA where there are 10s of
I've always wondered about this ... and thankfully, now have a good environment of
I've always wondered about this. I have an @property called hitCounter and this works
Ive always wondered about this. I like to create super navigation menus. The website
I've always wondered this - why can't you declare variables after a case label
I have always wondered how people update a previous line in a command line.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.