bonze (callback) .each

Calling the bonze instance as a function iterates over all elements. .each is an alias for the same operation.

Direct call $(sel)(callback)

The callback receives (element, index, allElements). The return value is the bonze instance - chainable.

alpha
beta
gamma
delta
epsilon
// click a button

.each alias

$(sel).each(cb) is exactly the same as $(sel)(cb). It's a semantic alias for readability.

alpha
beta
gamma
delta
epsilon
// click a button

Chaining

The callback always returns the bonze instance, so you can chain multiple operations fluently.

item-0
item-1
item-2
item-3
item-4
item-5
// click a button