How to do this is now described in the JSDoc documentation, and it uses an ellipsis, such as Closure documents.
@param {...<type>} <argName> <Argument description>
You need to specify the type to use after the ellipsis, but you can use * to describe the acceptance of something or use | to separate several acceptable types. In the generated documentation, JSDoc will describe this argument as repeatable, in the same way it describes optional arguments as optional.
In my testing, there was no need to have an argument in defining the actual javascript function, so your actual code can only have empty parentheses, i.e. function whatever() { ... } .
Single type:
@param {...number} terms Terms to multiply together
Any type (in the example below, square brackets mean items , both optional and repeatable will be marked):
@param {...*} [items] - zero or more items to log.
Many types need parentheses around the type list with an ellipsis before opening:
@param {...(Person|string)} attendees - Meeting attendees, listed as either String names or {@link Person} objects
Daniel Baird Feb 16 '15 at 6:49 2015-02-16 06:49
source share