Either to the right (if comment and code are both very short) or above. Never after — that's just confusing and inconsistent with how standards such as JSDoc, JavaDoc, PHPDoc etc. work. For example:
/**
* Capitalizes the first letter of a string
* @param {string} str
* @returns {string}
*/constcapitalize=(str)=>str.charAt(0).toUpperCase()+str.slice(1)
Either to the right (if comment and code are both very short) or above. Never after — that's just confusing and inconsistent with how standards such as JSDoc, JavaDoc, PHPDoc etc. work. For example:
ah okay!