Skip to content

Instantly share code, notes, and snippets.

@rbiggs
Created October 12, 2019 04:19
Show Gist options
  • Save rbiggs/466325c64af1c66ba8d5c1e622d32f15 to your computer and use it in GitHub Desktop.
Save rbiggs/466325c64af1c66ba8d5c1e622d32f15 to your computer and use it in GitHub Desktop.
Function with Parameter types -- JSDoc sample
/**
* A function that takes two arguments: a name and age.
* @param {string} name
* @param {number} age
* returns {{name: string, age: number} Person object
*/
function makePerson(name, age) {
return {name, age}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment