7.1 General form

The basic formatting of JSDoc blocks is as seen in this example:

  1. /**
  2. * Multiple lines of JSDoc text are written here,
  3. * wrapped normally.
  4. * @param {number} arg A number to do something to.
  5. */
  6. function doSomething(arg) { }

or in this single-line example:

  1. /** @const @private {!Foo} A short bit of JSDoc. */
  2. this.foo_ = foo;

If a single-line comment overflows into multiple lines, it must use themulti-line style with /* and / on their own lines.

Many tools extract metadata from JSDoc comments to perform code validation andoptimization. As such, these comments must be well-formed.