-
Notifications
You must be signed in to change notification settings - Fork 240
@return
nene edited this page Mar 21, 2012
·
8 revisions
Synopsis:
@return
Some description...
@return {Type}
Some description...
@return {Type} return.subproperty
Some description...
Documents the return value of a method. You can either use @return
or @returns
.
For constructors the return type defaults to Object
, otherwise it defaults to undefined
which means the return value is not shown in documentation.
To document properties of the object that is returned, use the following syntax:
/**
* @return {Object} A user record
* @return {String} return.name The name of the user.
* @return {String} return.email The email of the user.
*/
function getUser() {
}
When returning a function, its parameters and return value can also be documented:
/**
* @return {Function} A predicate function that
* determines is number is odd or even.
* @return {Number} return.value The number to test.
* @return {Boolean} return.return True if number is even.
*/
function createEvenPredicate() {
}
See also documentation for @param.