How do you document your JavaScript? I use JSDoc. It's a tool which goes through your source code, looks at comments, and generates a set of HTML files containing your documentation. Being inline with your code, the documentation is human readable even without generating the documentation. And as a bonus, it is less likely to become outdated as your code evolves.

This blog post is a short how-to for JSDoc. It describes how to install JSDoc using npm, and how to configure it using a configuration file.

We explore how to use JSDoc to document functions, modules, objects, and classes using both ES6 and ES5 syntax.