@example
Оглавление
Обзор
Приведите пример использования документированного элемента. Текст, следующий за этим тегом, будет отображен как выделенный код.
Примеры
Обратите внимание, что у документации может быть несколько примеров.
Документирование примеров
/**
* Solves equations of the form a * x = b
* @example
* // returns 2
* globalNS.method1(5, 10);
* @example
* // returns 3
* globalNS.method(5, 15);
* @returns {Number} Returns the value of x for the equation.
*/
globalNS.method1 = function (a, b) {
return b / a;
};
Примеры также могут иметь подписи, используя <caption></caption> после тега @example.
Документирование примеров с подписью
/**
* Solves equations of the form a * x = b
* @example <caption>Example usage of method1.</caption>
* // returns 2
* globalNS.method1(5, 10);
* @returns {Number} Returns the value of x for the equation.
*/
globalNS.method1 = function (a, b) {
return b / a;
};
© 2011–2017 the contributors to the JSDoc 3 documentation project
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://jsdoc.app/tags-example.html