3

How can I properly document array spread parameter?

It's actually an array of parameters, and each element have some type (let's think that all of them are strings for example)

If I document it as {Array<String>} args my IDE (WebStorm) complains about wrong argument types (when call this function with many params) - fair enough though, but I don't how to document it properly.

/**
 * @param {???} args
 */
function test(...args) {
  // ...
}

test('a', 'b', 'c')
Maksim Nesterenko
  • 5,661
  • 11
  • 57
  • 91

0 Answers0