Java has Javadoc, Python has docstring. Is there something similar in JavaScript?
JSDoc 3 is an API documentation generator for JavaScript, similar to Javadoc or phpDocumentor. You add documentation comments directly to your source code, right alongside the code itself.
Usually, most developers use /* and */ syntax to write multi-line block comments. But the standard way to use block comments in JavaScript is to; Start with /** in a blank line. End with */ at the end line.
But that's where I was wrong — Javascript has docstrings (or its equivalent) and they're the tooltips that I love in VSCode. These guides are wonderful because they articulate the contract that you are agreeing to when you use the method or ask about the property.
The most commonly used is JsDoc (https://jsdoc.app/).
This is also a tool that generates documentation from your sources, commented with JsDoc style: https://github.com/jsdoc3/jsdoc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With