diff --git a/JSDoc-support-in-JavaScript.md b/JSDoc-support-in-JavaScript.md index d2435d6d..9b4a7ad8 100644 --- a/JSDoc-support-in-JavaScript.md +++ b/JSDoc-support-in-JavaScript.md @@ -203,4 +203,21 @@ function fn9(p1){} // Inline JsDoc comments (treated as 'any') function fn10(/** string */ p1){} +// Class property declarations. Array properties will still need a @type +// declaration within the constructor. +/** + * @property {string} name + * @property {string[]} keys + */ +class Foo { + /** + * @param {string} [name = 'Foo'] + * @param {string[]} keys + */ + constructor(name = 'Foo', keys) { + this.name = name; + /** @type {string[]} keys */ + this.keys = keys; + } +} ```