Querying a Layer using an ArcGIS Online Map

While exploring the possibilities of ArcGIS API for JavaScript, I was wondering how to query a web map that has been created through ArcGIS Online. I spent quite a lot of time trying to figure out how to pass my Web Map created through ArcGIS Online as a URL. Especially for “var MapServiceToDisplay” and “var …