Let me know if you still need help.
In generally, you can pass an array of layers to a function.
Each time you loop through the array, you execute an querytask.
Last, use an instance of "dojo/promise/all" to wait until all results are received and do something.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.