W3cubDocs

/JSDoc

@default

Table of Contents

Synonyms

@defaultvalue

Syntax

@default [<some value>]

Overview

The @default tag allows you to document the assigned value of a symbol. You can supply this tag with a value yourself or you can allow JSDoc to automatically document the value from the source code -- only possible when the documented symbol is being assigned a single, simple value that is either: a string, a number, a boolean or null.

Examples

In this example a constant is documented. The value of the constant is 0xff0000. By adding the @default tag this value is automatically added to the documentation.

Document the number value of a constant
/**
 *  @constant
 *  @default
 */
const RED = 0xff0000;

© 2011–2017 the contributors to the JSDoc 3 documentation project
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://usejsdoc.org/tags-default.html