Evi*_*Syn 51 javascript comments
我习惯使用atlas,首选(据我所知)方法是使用xml注释,例如:
/// <summary>
/// Method to calculate distance between two points
/// </summary>
///
/// <param name="pointA">First point</param>
/// <param name="pointB">Second point</param>
///
function calculatePointDistance(pointA, pointB) { ... }
Run Code Online (Sandbox Code Playgroud)
最近我一直在寻找其他第三方JavaScript库,我看到的语法如下:
/*
* some comment here
* another comment here
* ...
*/
function blahblah() { ... }
Run Code Online (Sandbox Code Playgroud)
作为奖励,如果有任何可以读取"首选"评论风格的JavaScript API生成器,请告诉我.
Chr*_*ald 75
/**
* Shape is an abstract base class. It is defined simply
* to have something to inherit from for geometric
* subclasses
* @constructor
*/
function Shape(color){
this.color = color;
}
Run Code Online (Sandbox Code Playgroud)
mol*_*oco 12
越简越好,评论很好,使用它们:)
var something = 10; // My comment
/*
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
in reprehenderit in voluptate velit esse cillum dolore eu
fugiat nulla pariatur.
*/
function bigThing() {
// ...
}
Run Code Online (Sandbox Code Playgroud)
但对于自动生成的文档......
/**
* Adds two numbers.
* @param {number} num1 The first number to add.
* @param {number} num2 The second number to add.
* @return {number} The result of adding num1 and num2.
*/
function bigThing() {
// ...
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
50450 次 |
| 最近记录: |