如何使用JSDoc记录简单JavaScript对象(及其导出)的源代码是最佳方法?
例如,我想记录以下对象:
/** how do I JSDocument object baseAdder? */
const baseAdder = {
/** how do I JSDocument property base? */
base: 1,
/**
* Add a number to base
* @param {number} a the number to be added to base
* @returns {number} the sum of the number plus base
*/
f: function(a) {
return this.base + a;
}
};
/** how do I JSDocument this export? Should I? */
module.exports = baseAdder;