diff --git a/content/en/tags-property.md b/content/en/tags-property.md index 1d1d4462..a14b9984 100644 --- a/content/en/tags-property.md +++ b/content/en/tags-property.md @@ -50,3 +50,17 @@ var config = { }; ``` {% endexample %} + +The following example shows how to indicate that a property is optional. + + {% example "A type definition with required and optional property" %} + + ``` +/** + * User type definition + * @typedef {Object} User + * @property {string} email + * @property {string} [nickName] + */ + ``` + {% endexample %} \ No newline at end of file diff --git a/tags-property.html b/tags-property.html index 26b08e8a..fcf66e0b 100644 --- a/tags-property.html +++ b/tags-property.html @@ -69,8 +69,16 @@

Examples

} } }; - - + +

The following example shows how to indicate that a property is optional.

+
+
A type definition with required and optional property
/**
+ * User type definition
+ * @typedef {Object} User
+ * @property {string} email
+ * @property {string} [nickName]
+ */
+