@borrows

.. @borrows::
语法

@borrows <that namepath> as <this namepath>

概述

@borrows标签允许您将另一个符号的文档添加到文档中.

如果您有多种方法来引用函数, 那么此标记将非常有用, 但您不希望在两个位置复制相同的文档.

示例

在这个例子中, 存在“trstr”函数的文档, 但“util.trim”只是通过不同的名称引用同一个函数.

Duplicate the documentation for trstr as util.trim
/**
 * @namespace
 * @borrows trstr as trim
 */
var util = {
    trim: trstr
};

/**
 * Remove whitespace from around a string.
 * @param {string} str
 */
function trstr(str) {
}