Just curious what’s a good way to comment what parameters will be passed to the callback function.
Suppose we have the following code and incomplete comments
/**
* an utterly useless function
*
* @param {String} an useless string
* @param {Boolean} an useless boolean
* @param {Function} ???
*/
function Useless (str, bool, callback) {
callback(str, bool);
}
What’s a good way to say callback will be called with str and bool are parameters?
Usually you will just write an invocation of the function with speaking names:
Or, if the parameters need explanation, you can use a multiline description: