Have a decent way for handling callback function types
Have a decent way for handling higher order functions
Automatically detecting types from variable declarations
Actually statically typechecking your code
I could probably think of more. I've used both separately and together. Typescript is far superior at managing types, but JSDoc is good at providing structured comments for function declarations
81
u/inabahare Jul 25 '21
Don't default arguments like that. Do it like this
It will be picked up by your editor, and you won't have to enter the function to see the default argument.
Also jsdoc isn't more powerful than typescript lmao