Is there a commonly accepted name for the objects passed around by jQuery?
jQuery deals mostly in chain-able function calls which accept and return the same type of objects, which are a kind of collection object wrapping arbitrary bits of HTML or DOM nodes which may or may not be connected.
- They are returned by “selectors”
$('#target') - they are also created or constructed by various calls like
$('<div>')
These objects can almost always be a collection, that is somewhat list-like or array-like, even though often some calls appear to deal in single items.
Such objects are not real JavaScript arrays though as revealed by the existence of a $.makeArray() function.
The term I most notice is “selectors” or “selections” but it doesn’t seem right to use this term for the result of $('<span>') as it focuses on just one aspect of these objects, there is a similar problem with the term “wrapper” which I also see used.
The objects are chainable because each and every one of them implements the entire jQuery interface, but I don’t recall people calling them ‘jQuery objects’, it feels wrong.
So there are arguments for not calling them “selections” or “arrays” or “jQuery objects”. What about “lists” or “collections”? When we need to name these objects what do people generally call them?
Any jQuery selector will return a jQuery object – that is their common name.