Synonyms
yield
语法
¥Syntax
@yields [{type}] [description]
概述
¥Overview
@yields
标记记录了生成器函数生成的值。此标签在 JSDoc 3.5.0 及更高版本中可用。
¥The @yields
tag documents the value that is yielded by a generator function. This tag is available
in JSDoc 3.5.0 and later.
如果你正在记录常规函数,请使用 @returns
标签 而不是此标签。
¥If you are documenting a regular function, use the @returns
tag instead of this
tag.
示例
¥Examples
/**
* Generate the Fibonacci sequence of numbers.
* * @yields {number}
*/
function* fibonacci() {}
/**
* Generate the Fibonacci sequence of numbers.
* * @yields {number} The next number in the Fibonacci sequence.
*/
function* fibonacci() {}