Is there a convention on how to document a JavaScript file with comments? Like function signatures, examples, etc

Solution 1:

The most commonly used is JsDoc (https://jsdoc.app/).

This is also a tool that generates documentation from your sources, commented with JsDoc style: https://github.com/jsdoc3/jsdoc