I was just looking over the Esri JS API documentation and the Esri REST API documentation at query operations. I noticed that the query REST endpoint is called by the FeatureLayer.queryFeatures function. The query REST endpoint has an option for returnDistinctValues to get a list of unique values in a field. Why isn't this an option for the Query object in the JS API. It's always a lot of trouble to have to sift through the results of a query to get the unique values and it's even worse when there are more values than are returned by a single query.