2 ms·
My concern isn't really with it causing bugs in my code; it's more with trying to decipher other people's code and making their lives easier when they have to r
by natrius 19y ago
My concern isn't really with it causing bugs in my code; it's more with trying to decipher other people's code and making their lives easier when they have to read mine. I was skeptical about chaining at first too, but it all seems nice except for .end().
The speed question is because I don't know how jQuery actually goes about selecting elements. For example, with 'div.entry', I presume it does something like a getElementsByTagName('div'), then iterates through those to find the ones that have class 'entry'. If jQuery stores that somewhere and .end() has some sort of magic to get the precomputed list back that $() itself doesn't, I thought it might be slower. The method you showed avoids that, but at the cost of precious, precious keystrokes. I guess I'll just poke around in the code at some point to see what's going on.