This question already has an answer here:
I was researching proper commenting practices for JavaScript and highly upvoted answer (+100) cites JSDoc-like commenting. JSDoc promotes comments like this:
/**
* Represents a book.
* @constructor
* @param {string} title - The title of the book.
* @param {string} author - The author of the book.
*/
function Book(title, author) {
}
From my understanding, good comments should explain "why" not "what" and the above looks like alot of "what" to me.
Why should JavaScript be commented / documented in this way, and how does this relate to the popular "why, not how" commenting policy?