语法
@borrows <that namepath> as <this namepath>
概述
@borrows 标记允许您向文档中添加另一个符号的文档。
如果您有多种方法引用函数,但不想在两个位置重复相同的文档,则此标记将非常有用。
示例
在此示例中,存在“trstr”函数的文档,但“util.trim”只是对该函数的引用,名称不同。
/**
* @namespace
* @borrows trstr as trim
*/
var util = {
trim: trstr
};
/**
* Remove whitespace from around a string.
* @param {string} str
*/
function trstr(str) {
}