/**
* Calculate the total sum of all numbers provided to the function.
* @example
* sum([1,2,3])
* //results in 6
* sum(1,2,3)
* //results in 6
* @param {number[]|...number} params - Represents an array of numbers or individual numbers passed as arguments
*/
function sum(params) {
var args = params instanceof Array ? params : arguments;
for (var i = 0, sum = 0; i < args.length; i++)
sum += args[i];
return sum;
}
'params' may be an array or a series of individual numbers
However, specifying "@param {number[]|...number}" does not work.
The defined documentation output is identical to "@param {number[]|number}"
What would be the most appropriate way to clarify this situation?