Not only that, Umbrella will handle many more class name separations compared to jQuery. All of these (and more) are valid:
u('a').addClass('a,b c', 'd'); // No typo here, four classes added
u('a').addClass(['a'], ['b,c', ['d']]); // Again no typo, 4 classes added
Of course you normally don't use this, but you might have the class list in an array or a comma-separated string or something else which makes it really convenient and it was basically for free as the method is really reusable. See the documentation:
Nop, but if you want to be fair jQuery's addClass is also not implemented in those 29 lines of code, it also uses these: each, jQuery.isFunction, getClass and stripAndCollapse.
Umbrella's single eacharg() uses in exchange .each() (which is public-facing, so it really doesn't count) and .args(), which is private but used in MANY places through the code. At 11 lines for args(), I'd say proportionally it'd be 1-3 lines corresponding to addClass. So worst-case scenario it'd be the equivalent to 8 lines exclusive for a much more flexible function with no internal dependencies which is still alot less than jQuery's 29 lines with 3 internal dependencies and 1 external.
* I wrongly counted spaces in jQuery's function while I didn't in Umbrella
Edit: the magic for the size of Umbrella JS is really through heavy code reuse and modern API usage. For this example, el.classList.add(name);
There is a case where jQuery cannot use it since they aim to support SVG in all officially supported browsers, and classList doesn't work properly inside SVG in IE11 (Umbrella doesn't officially support SVG).
I tried refactoring a bit of the code of jQuery, but every thing I touched or changed a lot of tests failed; so I'd have to do a ton of work ignoring the tests and then fix a ton of bugs for a low chance of success (so it was not cost-effective relatively to improving Umbrella).
u('a').addClass((el, i) => (i % 2 == 0) ? 'odd' : '');
See example: https://jsfiddle.net/r2f87hzk/
Not only that, Umbrella will handle many more class name separations compared to jQuery. All of these (and more) are valid:
u('a').addClass('a,b c', 'd'); // No typo here, four classes added
u('a').addClass(['a'], ['b,c', ['d']]); // Again no typo, 4 classes added
Of course you normally don't use this, but you might have the class list in an array or a comma-separated string or something else which makes it really convenient and it was basically for free as the method is really reusable. See the documentation:
https://umbrellajs.com/documentation#addclass