commenting callback functions

Viewed 2040

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?

4 Answers
/**
 * an utterly useless function
 *
 * @param {String} an useless string
 * @param {Boolean} an useless boolean
 * @param {(param1:Number, param2:String ...)=>{}} callback
 */

function Useless (str, bool, callback) {
  callback(str, bool);
}
Related