Skip to main content

@inheritdoc

Syntax

@inheritdoc

Overview

@inheritdoc tells JSDoc to copy the documentation from the nearest ancestor that has a comment for the same member. Use it on overridden methods when the behaviour (and therefore the documentation) is identical to the parent.

Example

class Animal {
/**
* Speak in the animal's natural voice.
* @returns {string}
*/
speak() { return '...'; }
}

class Dog extends Animal {
/**
* @inheritdoc
*/
speak() { return 'Woof!'; }
}

See also

Official reference: jsdoc.app/tags-inheritdoc