There is a part of the Cesium source code that I don't understand

I am trying to customize MaterialProperty, so I am learning by looking at the source code. In the PolylineOutlineMaterialProperty.js code, there are several internal variables defined, including _color and _outlineColor. I noticed that they are not assigned any values, and I’m wondering what their specific roles are. Could you please explain? Thank you very much.

  this._color = undefined;
  this._colorSubscription = undefined;
  this._outlineColor = undefined;
  this._outlineColorSubscription = undefined;
  this._outlineWidth = undefined;
  this._outlineWidthSubscription = undefined;

For deeper technical details, someone from the CesiumJS core team might chime in here. But I’ll try to give a short, first summary:

These are the private variables that correspond to the public properties of that class.

For example, there is the property color in the PolylineOutlineMaterialProperty. And there is some magic happening in the code, with the line that says color: createPropertyDescriptor("color") in the PolylineOutlineMaterialProperty class: It calls the createPropertyDescriptor function, which can be imagined as “a function that creates a ‘setter’ and a ‘getter’”. Namely, a ‘setter’ and ‘getter’ for the private variable.

You can see that these setter/getters operate on a property that is called _${name.toString()}. So the createPropertyDescriptor("color") call it will basically create a setter/getter for the (private!) _color property.

(And it sets up all the wiring that is required, for example, to receive events when the property value changes. That’s the ...Subscription part there)

Thank you very much, you have helped me solve a big confusion.