What is a standard for commenting a function in JavaScript?

JavascriptWeb DevelopmentFront End Technology

To comment a function in JavaScript, you can use the following standard −

/**
* Adds two numbers
* @param {Number} num1
* @param {Number} um
* @return {Number} sum
*/
function sum(num1,num2) {
   return num1 + num2;
}
raja
Published on 29-Jan-2018 11:03:43
Advertisements