15 * @param {string} n - A string param
16 * @param {string} [o] - A optional string param
17 * @param {string} [d=DefaultValue] - A optional string param
18 * @return {string} A good string
25 function foo(n, o, d) {
30 See: <https://jsdoc.app/index.html>
34 | Type | Description |
35 | ------------------------------- | ------------------------------------- |
36 | `@param {string=} n` | Optional |
37 | `@param {string} [n]` | Optional |
38 | `@param {(string|number)} n` | Multiple types |
39 | `@param {*} n` | Any type |
40 | `@param {...string} n` | Repeatable arguments |
41 | `@param {string} [n="hi"]` | Optional with default |
42 | `@param {string[]} n` | Array of strings |
43 | `@return {Promise<string[]>} n` | Promise fulfilled by array of strings |
45 See: <https://jsdoc.app/tags-type.html>
68 * @typedef {Object} Song
69 * @property {string} title - The title
70 * @property {string} artist - The artist
71 * @property {number} year - The year
78 * @param {Song} song - The {@link Song} to be played
81 function play(song) {}
84 See: <https://jsdoc.app/tags-typedef.html>
93 * @typedef {{title: string, artist: string, year: number}} Song
102 * @param {Song} song - The {@link Song} to be played
105 function play(song) {}
108 See: <https://jsdoc.app/tags-typedef.html>
114 * @typedef {import('./Foo').default} Bar
124 This syntax is [TypeScript-specific](https://github.com/Microsoft/TypeScript/wiki/JsDoc-support-in-JavaScript#import-types).
130 * @throws {FooException}
141 See the full list: <https://jsdoc.app/index.html#block-tags>
152 Prefer `alias` over `name`. See: <https://jsdoc.app/tags-alias.html>