是否有关于如何用注释记录 JavaScript 文件的约定?像函数签名、示例等
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18529526/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is there a convention on how to document a JavaScript file with comments? Like function signatures, examples, etc
提问by runw
Java has Javadoc, Python has docstring. Is there something similar in JavaScript?
Java 有 Javadoc,Python 有 docstring。JavaScript 中有类似的东西吗?
采纳答案by Tibos
The most commonly used is JsDoc (https://jsdoc.app/).
最常用的是 JsDoc ( https://jsdoc.app/)。
This is also a tool that generates documentation from your sources, commented with JsDoc style: https://github.com/jsdoc3/jsdoc
这也是一个从你的来源生成文档的工具,用 JsDoc 风格评论:https: //github.com/jsdoc3/jsdoc