OK on the desktop this is simple, a layer is a discrete data set, a shapefile, a layer in a geodatabase or something.
However it seems to me to have two usages for the Javascript API. Take this from http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm
"This sample shows how to use the Legend widget to build a legend that displays swatches and labels for the layers in the map.................The legend is displayed in one pane of the accordion container and a link that allows you to toggle the visibility of layers in the map is displayed in the other"
In the instance of "layers" this refers to the discrete datasets on the map, in this example, Campgrounds, Shelters, Earthquakes etc, and refers to the legend items for each of these "layers"
The second instance refers to map services added by "map.addLayers" and will give a tick box per map service - which could contain shed loads of, what I would call, "layers"
Have I missed something here?
ACM
Cheers - but this isn't consistent, for example .visibleLayers returns the visible discrete datalayers within a ArcGISDynamicMapServiceLayer
So I'm still confused!
a discrete data set, a shapefile, a layer in a geodatabase or something. Those are tables, feature classes, etc. A layer is a Feature Class,etc. with its associated symbology.