Documentation e.g. vs static method name paths in JSDoc

When documenting javascript methods, I know that using #a name path means an instance method, for example:

function Class() {}

/**
 * Class#method1
 */
Class.prototype.method1 = function () {}

However, I also saw the use of ~and .. What are they used for?

/**
 * Class~method2
 * Class.method3
 */

Are there any other syntaxes I should be aware of?

+4
source share
1 answer

You can see the details for the conventions of variable names / methods here .

. ( ), . , (, new) .

:

Class.foo = function () {
  // ...
};

var blah = new Class();
blah.foo();  // throws an error

Class.foo();  // actually calls the function

~ ( ), function. , .

:

function Class() {
  // this function is not accessible outside of the constructor
  function inner() {
  }

  // unless we give it some other reference that is visible:
  this.accessInner = inner;
}

blah = new Class();
blah.inner();        // throws an error
Class.inner();       // also throws an error
blah.accessInner();  // will actually call inner
+4

All Articles