Skip to content

Instantly share code, notes, and snippets.

@mul14
Created July 25, 2018 14:29
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save mul14/c31c3bda510a552924ea027cccececb4 to your computer and use it in GitHub Desktop.
Save mul14/c31c3bda510a552924ea027cccececb4 to your computer and use it in GitHub Desktop.
JavaScript DocBlock Cheat Sheet
/**
* Description of this function.
*
* @param {string} name
* @param {Date} birthday
* @param {boolean=} isMarried Optional parameter.
* @param {string|null} [bloodType]
* @param {number=} [weight=0] Optional parameter with default value.
* @param {string[]} favoriteFoods Array of String.
*
* @returns {Object}
*/
function Person(name, birthday, isMarried, bloodType = null, weight = 0, favoriteFoods = []) {
return {
name,
birthday,
weight,
bloodType,
isMarried,
favoriteFoods,
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment