Reply to comment

Less clear? Eh, ok...

First and foremost let me say that I'm not doing this to save 16 bytes. Ellis was just curious what it would be gzip'd so after a discussion he ran some tests and I added it to the post.

Furthermore, I agree, to an extent, that it makes the code slightly less readable, but no more than saving a measly 16 bytes. And personally, if you AREN'T a jQuery developer the syntax above is easier to write and easier to remember imo. And if you ARE a jQuery developer it saves time, especially in larger projects.

In the end it's a preference of syntax, so if given two options, I'll often choose the one that's easier to type. Personal preference I guess. Nonetheless, the comments are greatly appreciated and valid points have been raised.

Reply

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
6 + 9 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.