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);
}

  

posted @ 2020-05-23 23:42  arun_python  阅读(233)  评论(0编辑  收藏  举报