15 * @param {string} n - A string param
16 * @return {string} A good string
23 function foo(n) { return n }
26 See: <http://usejsdoc.org/index.html>
30 | Type | Description |
32 | `@param {string=} n` | Optional |
33 | `@param {string} [n]` | Optional |
34 | `@param {(string\|number)} n`| Multiple types |
35 | `@param {*} n` | Any type |
36 | `@param {...string} n` | Repeatable arguments |
37 | `@param {string} [n="hi"]` | Optional with default |
38 | `@param {string[]} n` | Array of strings |
39 | `@return {Promise<string[]>} n` | Promise fulfilled by array of strings |
41 See: <http://usejsdoc.org/tags-type.html>
64 * @typedef {Object} Song
65 * @property {string} title - The title
66 * @property {string} artist - The artist
67 * @property {number} year - The year
74 * @param {Song} song - The {@link Song} to be played
77 function play (song) {
81 See: <http://usejsdoc.org/tags-typedef.html>
88 * @typedef {{title: string, artist: string, year: number}} Song
95 * @param {Song} song - The {@link Song} to be played
98 function play (song) {
102 See: <http://usejsdoc.org/tags-typedef.html>
108 * @typedef {import('./Foo').default} Bar
118 This syntax is [TypeScript-specific](https://github.com/Microsoft/TypeScript/wiki/JsDoc-support-in-JavaScript#import-types).
124 * @throws {FooException}
143 Prefer `alias` over `name`. See: <http://usejsdoc.org/tags-alias.html>