【JS】注释规范

2019-06-19  本文已影响0人  大Q本Q

JavaScript 注释规范


/**
 * This callback type is called `requestCallback` and is displayed as a global symbol.
 *
 * @callback requestCallback
 * @param {number} responseCode
 * @param {string} responseMessage
 */

/**
 * Does something asynchronously and executes the callback on completion.
 *
 * @method doSomethingAsynchronously
 *
 * @param {requestCallback} cb - The callback that handles the response.
 *
 * @param {number|string|Object[]|Array|*} list - param description
 * @param {string} list[].attr - 若list为包含对象的数组,attr为对象的属性
 * 
 * @param {number} [type=1] - 可选,并带默认值的参数
 
 * @returns {string}
 */
function doSomethingAsynchronously(cb,list,type) {
    // code
};
上一篇 下一篇

猜你喜欢

热点阅读