-
-
Save rbiggs/466325c64af1c66ba8d5c1e622d32f15 to your computer and use it in GitHub Desktop.
Function with Parameter types -- JSDoc sample
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
/** | |
* 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