categories – How do I get the category terms (multiple) queried on a category page?

Here’s an example of a URL showing results from both the foo or bar category (note: I’m using pretty permalinks):,bar

Based on this URL, and without parsing the URL itself, how can I get an array of the category terms used in this query?

I see them on the global $wp_query object here:


However, I’m looking for a more elegant way to retrieve them.