Skip to main content

@lends

Syntax

@lends ClassName
@lends ClassName.prototype

Overview

@lends tells JSDoc that an object literal's properties should be attributed to a class or namespace, not to the anonymous object itself. It is most useful with the revealing-module or factory patterns.

Example

var Animal = (function () {
/**
* @lends Animal.prototype
*/
return {
/**
* @constructs Animal
* @param {string} name
*/
init(name) {
this.name = name;
},

/**
* @returns {string}
*/
speak() {
return `${this.name} makes a sound.`;
},
};
}());

See also

Official reference: jsdoc.app/tags-lends