I'm still new to Javascript so when my editor highlights it I'm intrigued. what exactly does it do?
Example: /// things go after here
Some documentation generators regard three slashes /// as introducing documentation comments to JavaScript.
See
http://msdn.microsoft.com/en-us/library/bb514138(v=vs.110).aspx
So three slashes work the same as two slashes as far as JavaScript is concerned (it's a comment-to-end-of-line), but three slashes can be interpreted by documentation generators to indicate a documentation section.
Example:
function getArea(radius)
{
/// <summary>Determines the area of a circle that has the specified radius parameter.</summary>
/// <param name="radius" type="Number">The radius of the circle.</param>
/// <returns type="Number">The area.</returns>
var areaVal;
areaVal = Math.PI * radius * radius;
return areaVal;
}
The first two slashes start a comment. The third slash does nothing.
The two main ways to comment in JS:
/* This way
Can go multi-line */
// This way is one line only
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