In the ArcGIS API for JavaScript documentation, edit the summary of executeForExtent(query, callback?, errback?) to include that the count is also returned.
This is already documented: 'Get the extent of the features that satisfy the input query. The count of features that satisfy the input query is returned as well. Valid only for hosted features services on arcgis.com and for ArcGIS Server 10.3.1 and later.' Refer to this link: https://developers.arcgis.com/javascript/3/jsapi/querytask-amd.html#executeforextent