7.9 Property comments
Property types must be documented. The description may be omitted for privateproperties, if name and type provide enough documentation for understanding thecode.
Publicly exported constants are commented the same way as properties.
/** My class. */
class MyClass {
/** @param {string=} someString */
constructor(someString = 'default string') {
/** @private @const {string} */
this.someString_ = someString;
/** @private @const {!OtherType} */
this.someOtherThing_ = functionThatReturnsAThing();
/**
* Maximum number of things per pane.
* @type {number}
*/
this.someProperty = 4;
}
}
/**
* The number of times we'll try before giving up.
* @const {number}
*/
MyClass.RETRY_COUNT = 33;