有没有办法避免必须为@property和@param键入两个单独的行,如果在示例中,在构造函数上,参数和属性具有相同的名称.
/**
* Class for representing a point in 2D space.
* @property {number} x The x coordinate of this point.
* @property {number} y The y coordinate of this point.
* @constructor
* @param {number} x The x coordinate of this point.
* @param {number} y The y coordinate of this point.
* @return {Point} A new Point
*/
Point = function (x, y)
{
this.x = x;
this.y = y;
}
Run Code Online (Sandbox Code Playgroud)