refactor(js): rewrite some parts for js doc rules

- function expressions instead function declarations
- some comments

time: 0h:40