Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
I use JSDoc more than 4 years and found it only from the positive side. Documentation is important to have in a project. It helps you to save time for remembering, teaching newcomers, support. The project may have different types of documentation. As an engineer, the important part of the documentation is code documentation and JSDoc solves that problem asĀ well.
Simple example
From the simple example, you may simply and fast understand what parameterās types are function takes. You should not look inside the function for that. More often functions, methods are more complicated and it takes time to jump into the function and see what parameterās typesĀ are.
Good example
Here you may find detailed documentation for a module. Just try to go through and if you do not understand what the module does we may have a callĀ āļø
Type annotations
One of the most powerful features that I like in JSDoc is types checking. It works perfectly in WebStorm. It wonāt replace a TypeScript but after you get used to writing JSDoc you will stop be worrying about types and most important you are not needed to waste time on any configuration part.
So, here you may see that WebStorm highlights which argument is not fitting assignable type. It helps to avoid bugs with types and most importantly saveĀ time.
š Thank you for reading. Suggestions, comments, thoughts are welcomeĀ š
If you like this, clap, follow me on medium, twitter, share with your friendsĀ š
JSDoc. JavaScript: The Useful Parts was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.