@param

  • constructor
documentjs.tags.param  

Adds parameter information to a [documentjs/tags/function @function] or [documentjs/tags/signature @signature].

@param {TYPE} NAME [DESCRIPTION]

Example:

/**
 * Finds an order by id.
 * @param {String} [id=0] Order identification number.
 * @param {function(Order)} [success(order)] Filter 
 * order search by this date.
 */
 findById: function( id, success ) {

Parameters

  1. TYPE {TYPE-EXPRESSION}

    A type expression.

    Use @option to detail a function's arguments or an object's properties.

  2. NAME {NAME-EXPRESSION}

Use @param within a @function comment block or after a @signature tag.

@param within a function comment

If using a comment preceeds a function like ...

/**
 * Finds an order by id.
 * @param {String} [id=0] Order identification number.
 * @param {function(Order)} [success(order)] Filter order search by this date.
 */
 findById: function( id, success ) {

... DocumentJS will automatically make the comment's [documentjs/DocObject DocObject] type a function and create params with just names (in this case id and success).

The comment's @params tags should use the same names as the function. Any params that specifies a name that isn't present is added at the end of the arguments.

@param within a signature

Use @param to specify the params in a signature.

/**
 * Finds an order by id.
 * 
 * @signature `Order.findById(id=0,[success])`
 * 
 * @param {String} [id=0] Order identification number.
 * @param {function(Order)} [success(order)] Filter order search by this date.
 */
findById: function( id, success ) {

When a @signature is used, any params automatically created from code are overwritten.