Basic Tags

Essential JSDoc tags for documenting your code

@description
Provides a description of the function, class, or variable

Syntax:

@description {string} Description text

Example:

/**
 * @description Calculates the sum of two numbers
 * @param {number} a - First number
 * @param {number} b - Second number
 * @returns {number} The sum
 */
function add(a, b) {
  return a + b;
}
@author
Specifies the author(s) of the code

Syntax:

@author {string} Author name <email>

Example:

/**
 * @author John Doe <john@example.com>
 * @author Jane Smith <jane@example.com>
 */
@version
Indicates the current version of the code

Syntax:

@version {string} Version number

Example:

/**
 * @version 1.2.0
 * @since 1.0.0
 */
@since
Specifies when the feature was first added

Syntax:

@since {string} Version when added

Example:

/**
 * @since 1.0.0
 * @description Added in the initial release
 */
@deprecated
Marks code as deprecated with migration guidance

Syntax:

@deprecated {string} Deprecation message

Example:

/**
 * @deprecated Since version 2.0.0. Use newFunction() instead.
 * @see {@link newFunction}
 */
function oldFunction() {
  // deprecated implementation
}