Provides an example of using a function or other code.
Example
/**
* Returns an array of arguments.
* @example var args = Array.fromArguments(arguments);
* @example var args = Array.fromArguments(arguments, 2);
*/
Array.fromArguments = function Array$fromArguments() ....
/**
* Implements a control that shows...
* @example lang=css
* #supercontrol {
* background-color: #FF6600; color: white; border: 1px solid #4F5C71;
* padding: 2px; position: absolute; visibility: hidden;
* filter: alpha(opacity=0.8); opacity: 0.8;
* }
*/
function SuperSuperControl() { .... }
Description
This token enables providing code usage examples. A comment block can contain any number of @example tokens. Example blocks will be interpreted and syntax-highlighted as JavaScript. To make ECMADoc interpret an example as another language, set its name in the
lang section of the @example token.
lang=<lang> example
- The lang of the example (name=value pair of lang=<the name of the language>). Optional.
(The languages that will be syntax highlighted are 'javascript and 'css'). - The example itself. Required.
(Any characters until the next token or until the end of the comment).
See also
All tokens
@syntax