Skip to content

Instantly share code, notes, and snippets.

@rbiggs
Created July 16, 2019 14:30
Show Gist options
  • Save rbiggs/ace693f2eeb13ad23ef608a8852a142c to your computer and use it in GitHub Desktop.
Save rbiggs/ace693f2eeb13ad23ef608a8852a142c to your computer and use it in GitHub Desktop.
Show how to use Closure Compile syntax for optional properties
// 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