Synonyms
var
语法
🌐 Syntax
@member [<type>] [<name>]
概述
🌐 Overview
@member 标签用于标识任何没有更具体类型的成员,例如“class”(类)、“function”(函数)或“constant”(常量)。成员可以可选地具有类型以及名称。
🌐 The @member tag identifies any member that does not have a more specialized kind, such as "class", "function", or "constant". A member can optionally have a type as well as a name.
示例
🌐 Examples
/** @class */
function Data() {
/** @member {Object} */
this.point = {};
}
这里是一个使用 @var 的示例,@var 是 @member 的同义词,用于记录一个(虚拟)变量 'foo'。
🌐 Here is an example of using @var, a synonym of @member, to document a (virtual) variable 'foo'.
/**
* A variable in the global namespace called 'foo'.
* @var {number} foo
*/
上面的例子相当于下面的例子:
🌐 The above example is equivalent to the following:
/**
* A variable in the global namespace called 'foo'.
* @type {number}
*/
var foo;