@classdesc
Syntax
@classdesc text
Overview
When you use @class on a function, the function's description applies to the constructor. @classdesc lets you write a separate description for the class itself — the class-level description appears in the class summary, while the function-level description applies to the constructor signature.
Example
/**
* Creates a new Book instance.
* @class
* @classdesc Represents a book in the library catalogue.
* @param {string} title - The book title.
* @param {string} author - The author's full name.
*/
function Book(title, author) {
this.title = title;
this.author = author;
}
In the output:
- "Represents a book in the library catalogue." is shown in the class description.
- "Creates a new Book instance." is shown in the constructor signature.
See also
Official reference: jsdoc.app/tags-classdesc