TL;DR
Property is seen as undefined
in console.log
but (every) browser displays its value in developer tools.
I've tested this weird behavior on 2 machines (Windows and Linux) and 2 browsers (Chrome and Firefox). Code first (invoked 2 times in a loop):
var layer = map.getLayer(map.graphicsLayerIds[i]);
console.log(layer);
console.log(layer.name);
Result in browsers developer tools:
As you can see layer is an object (to be specific a FeatureLayer object). After clicking on it in firefox console I can see its properties as shown on the second image. However some of these properties are undefined although I can clearly see their values (and these values have expected content).
My teammates, also tested this one on their computers and have exactly the same output. What is going on?
EDIT: Here is documentation map.getLayer()