-
-
Save rbiggs/ace693f2eeb13ad23ef608a8852a142c to your computer and use it in GitHub Desktop.
Show how to use Closure Compile syntax for optional properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Define generic object. | |
// This can have any number of properties of type any. | |
/** | |
* @typedef {Object<string, any>} Member | |
* @property {string} name The members's name. | |
* @property {number=} age The members's age. | |
* @property {string=} job The member's job. | |
*/ | |
/** | |
* @type {Member} Jack | |
*/ | |
const Jack = { | |
age: 28 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment