'How do you write your own intellisense comments in a Javascript file?

In C# I can make comments that start /// before the definition of a class or function and these affect the intellisense tips shown when I write code that uses the type or function. But it isn't working in Javascript. Can I get these special comments and extra tips?



Solution 1:[1]

Not the far, but the comment should be in the js function.

Here is an exemple :

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;
  }

You will also find HowTo and doc in MSDN.

Solution 2:[2]

For VS 2017+ up to current date of this comment, you need to use JSDoc for TypeScript. "{string}" in this example means that param1 is of type string.

/**
 * A description for myFunction.
 * @param {string} param1 - The first argument to this function
 */
function myFunction(param1) {
...
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Cybermaxs
Solution 2 Heriberto Lugo