How to convert the result of jQuery .find() function to an array?

The majority of jQuery methods returns a jQuery object, which can be accessed like it is an array (e.g. it has a .length attribute, elements can be accessed using the square bracket notation ([0]), and it supports some array methods (slice())).

jQuery has a method called toArray() which can be used to convert the jQuery object to a real array.

You can also use get() with no arguments to achieve the same effect (and save you a few key presses).

In future, you can checkout the jQuery API, and the return type for all jQuery methods is listed in the relevant documentation (e.g. for find(), the return type is "jQuery")


If you call .get() on a jQuery object without a parameter, it will return a regular array of DOM elements.