JS docs - writing js docs

PHOTO EMBED

Mon Jul 08 2024 01:02:50 GMT+0000 (Coordinated Universal Time)

Saved by @davidmchale #jsdocs

/**
 * function to add two numbers together
 * @param {number} a this is the first number param
 * @param {number} b this is the second number param
 * @returns {number}
 */
function addNum(a = 0, b = 0) {
  return a + b;
}

addNum(4, 6);
content_copyCOPY

above the function type /** and enter JS docs will create params based on the params of a function above the @param we can write a description of the function beside each param call, we can write a comment about what each variable will do