diff --git a/guide/english/javascript/comments/index.md b/guide/english/javascript/comments/index.md index 5c88abd0f3..105f30beae 100644 --- a/guide/english/javascript/comments/index.md +++ b/guide/english/javascript/comments/index.md @@ -38,6 +38,20 @@ function hello() { } hello(); ``` +The third way is the `/** */` comment, a format popularly known as JSDoc, can be used to clearly describe functions, classes, methods, and variables in your codebase in a detailed way. For example: + +```javascript +/** + * Adds two numbers together + * + * @param {number} num1 - first parameter + * @param {number} num2 - second parameter + * @returns {number} + */ +function addTwoNumbers(num1, num2) { + return num1 + num2; +} +console.log(addTwoNumbers(10,20)) // will print 30 in the console. You can also prevent execution of Javascript code just commenting the code lines like this: ```javascript