3 ms·
Anybody who's written much JavaScript without a jQuery-like function should appreciate this too -- used to be much more common to have code littered with checks
by wwweston 13y ago
Anybody who's written much JavaScript without a jQuery-like function should appreciate this too -- used to be much more common to have code littered with checks to see if a dom element existed, then do an operation if it did. Performing an operation over a set (including empty) of elements seems easier.
- ape4 13y agoYes I thought of jQuery also. jQuery always returns an array. If it has no elements that means the thing wasn't found.