bonze .first() .last()

Target the first or last element of the current selection. Optional callback shorthand.

Without callback - returns a bonze instance

.first() and .last() return a new bonze wrapping a single element. Chain further operations on it.

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

With callback - iterates immediately

Pass a callback directly to .first(cb) or .last(cb) as a shorthand for .first()(cb).

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