3 ms·
JSdoc syntax looks like this: /* * Function that adds * @param {number} a One number to add * @param {number} b Another number to add *
by noahtallen 3y ago
JSdoc syntax looks like this:
/*
* Function that adds
* @param {number} a One number to add
* @param {number} b Another number to add
* @return {number} The added numbers
*/
function add(a, b) {
return a + b;
}
Ts syntax looks like this:
function add(a: number, b: number) {
return a + b;
}
You can use JS doc in TS as well, to document all the values. You just don’t put the types in :)