How to document an object property/method, when this property/method gets added to the object later, after the object has been initialized?
Example:
Let's say that I declare the following object. Documentation of ID and name work fine:
let AppUser = {
/** The user's id */
ID: 0,
/** The user's name */
name: "guest",
};
Later, I decided to add a property (let's say in another js file):
/** The role of the AppUser */
AppUser.role = "admin";
In that case, App.role's documentation does not work. At least, VSCode does not open the tooltip to inform me about its description.
What I do now, is declare an empty property inside the object: role:null, and also write its documentation. This workaround works OK.
