Linting and formatting of the js codes

The style guide is lacking this. Please follow the style seen in the existing code.