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
};
网友评论