【注释】前端JavaScript 编写文档注释

64 阅读1分钟

blog.csdn.net/chenlu52013… 看这个链接

 * 定义对象标签-用户对象
 * @typedef {object} User
 * @property {number} id - 用户ID
 * @property {string} name - 用户名
 * @property {string} email - 用户电子邮箱
 * @property {Date} birthday - 用户生日
 */
/**
 * xxxxxxxx
 * @deprecated 该函数已被废弃,请使用新的 addNumbers 函数代替。
 * @author xxxx <xxxxxx@qq.com>
 * @param {*} numbers - xxx
 * @param {*} name - xxx
 * @returns {User} - xxxx
 * @throws {Error} 如果除数为0,则抛出错误
 * @example
 * xxx(2, 'name')
 */