bonze .odd() .even()

Filter to odd or even indexed elements. Index is zero-based: .odd() keeps indices 0, 2, 4… and .even() keeps 1, 3, 5…

Six items

Each item shows its zero-based index. Click a button to see which are selected.

item [0]
item [1]
item [2]
item [3]
item [4]
item [5]
// click a button

With callback shorthand

Pass a callback directly: .odd(cb) is shorthand for .odd()(cb).

item [0]
item [1]
item [2]
item [3]
item [4]
item [5]
// click a button