018_jsdoc详解

一、常用jsdoc命令

jsdoc test.js -c conf.json -d arun      #Reference: https://jsdoc.app/about-commandline.html
jsdoc test.js -c conf.json -d arun --readme 01_2020522day25.md      #添加readme到首页
Reference: https://jsdoc.app/about-including-readme.html

二、经典案例

(1)可选参数(即可写可不写)

格式: Reference: https://jsdoc.app/tags-type.html

@param {number} [foo] // or: @param {number=} foo
/**
 * 
 * @param {string} [name] - the name
 * @param {number=} age  - the age
 */
function fn(name, age){
    console.log(name,age);
}

  

猜你喜欢

转载自www.cnblogs.com/arun-python/p/12945169.html