I just realized that the table titles in a FeatureLayer contain the service name as a prefix. This is reproducible in ArcGIS Enterprise 11.3 and currently in ArcGIS Online.
To be clear:
This gives me a list of "<LayerTitles>"...
webmap.allLayers.items.map(t => t.title)
...while this gives me a list of "<ServiceName> - <TableName>"
webmap.allTables.items.map(t => t.title)
Same goes for webmap.tables.
Is this a bug, @JuliePowell?
Here's a little sample to demonstrate the issue (open console): https://codepen.io/esride-Nik/pen/vENKeNj. This is what it looks like:
