Solved! Go to Solution.
if ((this.rootLayer instanceof (ArcGISDynamicMapServiceLayer) || this.rootLayer instanceof (ArcGISTiledMapServiceLayer)))
console.dir(layer)
if ((this.rootLayer instanceof (ArcGISDynamicMapServiceLayer) || this.rootLayer instanceof (ArcGISTiledMapServiceLayer)))
console.dir(layer)