What is the correct way of code comments in JavaScript

using // is better than /* */ because then you can use the latter to take out an entire block containing other comments. However, if you want to use an automatic documentation generation tool, you must use comments similar to javaDoc style.

This is an example that would work with YUI DOC (best one) https://yui.github.io/yuidoc/

/**
* This is a description
* @namespace My.Namespace
* @method myMethodName
* @param {String} some string
* @param {Object} some object
* @return {bool} some bool
*/

good practice is to use // instead of /* */

The reason for that is because if you have */ in any part of the comment (assuming you do not intend to end yet), it would end the comment. This happens even if */ is in a string. i.e. "*/" <--- this would end the comment and would likely to give you a syntax error.

note // ends at a line break so you would need // for every line of comment.