web: Docstrings and code style fixes for JavaScript code