Conceptually I prefer how bonzo puts the el as argument 0 rather than the index like jQuery does. Duplicating the el as the scope facilitates writing code for the most common usage (using the element, not the index) that is compatible with both libs.
This allows:
.addClass(function(el) {
el = this;
})
rather than:
.addClass(function(el) {
el = typeof el == 'number' ? this : el;
})
Conceptually I prefer how bonzo puts the
el
as argument 0 rather than the index like jQuery does. Duplicating theel
as the scope facilitates writing code for the most common usage (using the element, not the index) that is compatible with both libs.This allows:
rather than: