Several interfaces exist to assist you if you need to test specifics about the number of elements that match a given element specification.
#all
Use #all
to retrieve all matched elements:
#[]
Use #[]
to index a specific element from a matching set. Note that indexing starts at 1
, not 0
, so the first element in a set is [1]
.
You can also use #first
or #last
if you prefer:
#size
Use #size
to verify the length of a set of matched elements: