2 ms·
Can anyone show an example of before and after ? eg. .ts vs JSdoc
by z3t4 3y ago
Can anyone show an example of before and after ? eg. .ts vs JSdoc
- noahtallen 3y agoJSdoc 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 :)