He would just replace "layer" with whatever he called his layer at createDisplay().
If he isn't sure of the name of the layer, he could get a list of all layers in the display with:
layers = activeDisplay().getLayers()
And then remove individual layers by index number. For example, if he just has a map (index 0 in the list) and an image display (index 1 in the list) he could remove the image display layer with: