/**
* Example Class
* @property {string} name - The Object's name [A]
*/
class foo {
/**
*
* @param {string} name - The name to assign to the object [B]
*/
constructor(name){
/**
* The object's name [C]
* @type {string}
*/
this.name = name;
}
}
In this example I had to document name 3 times (2 times if we ignore the constructor parameter having a different purpose). With 4+ properties, it can get pretty packed.
Is there a way to:
Consolidate documenting properties before the class and inside the constructor [A] & [C]
Documenting the constructor input parameter and the instance parameter if they represent the same variable [B] & [C] :
constructor(name){ this.name = name}