Edit: This is technically a 2 part question. I\'ve chosen the best answer that covers the question in general and linked to the answer that handles the specific question.
You can use @callback or @typedef
.
/**
* @callback arrayCallback
* @param {object} element - Value of array element
* @param {number} index - Index of array element
* @param {Array} array - Array itself
*/
/**
* @param {arrayCallback} callback - function applied against elements
* @return {Array} with elements transformed by callback
*/
Array.prototype.map = function(callback) { ... }