Javascript - JsDoc

1 - About

JavaScript Documentation Tool (JSDoc) is a tool that parses inline documentation in JavaScript source files, and produces an documentation of the JavaScript code.

JSDoc is based on javadoc tool that was created for the same purpose for the Java programming language.

3 - Tag

3.1 - Variable (MemberOf / Full qualified name)


/**
 * @memberOf   myLib
 * or
 * @name       myLib.MyDynamicallyLoadedModule
 */
var MyDynamicallyLoadedModule = {};

3.2 - Object (Property)


/**
 * Test interface
 * @typedef {Object} Type
 * @property {String} tString - I'm a string
 * @property {Boolean} tBoolean - I'm a boolean
 * @property {Number} [tNumber=100] - I'm a number with a default value of 100
 * @property {Function} tFunction - I'm a function
 */

3.3 - Global Variable


/* global d3 */
/* global $ */

3.4 - Function (param, return)


/**
 * @param {Type} someParam
 * @return {undefined} 
 */
function testFunction(someParam) {
  //
}
/**
* @param myParam1
* @param {string=} myParam2 - an optional parameter
* @param {string} [somebody] - Somebody is an optional parameter
*/
function loadDocs(myParam1, myParam2){}

3.5 - Class (Static, augtments, ...


/**
 *  @class MyView
 *  @augments Backbone.View
 *  @static 
*/

3.6 - fileoverview

example:


/**
 * @fileoverview Search developers.google.com/web for articles tagged
 * "Headless Chrome" and scrape results from the results page.
 */

4 - Library

5 - Type checking with JsDoc and Typescript

6 - Documentation / Reference


Data Science
Data Analysis
Statistics
Data Science
Linear Algebra Mathematics
Trigonometry

Powered by ComboStrap