If I have the following HTML:
- List 1
- list 2
- list 3
var arr = $("li").map(function() { return $(this).text() }).get();
The map()(docs) method creates a jQuery object populated with whatever is returned from the function (in this case, the text content of each element).
The get()(docs) method (when passed no argument) converts that jQuery object into an actual Array.