I looked at UseJSDoc.org and the Googles Closure Compiler , and no documentation describes how to specify the length of an array.
My assumption is that the compiler only checks the type and not the length, so even if there is a syntax for explicitly describing the length of the array, an array of the wrong length will probably pass the compiler anyway (no error will be selected).
The best way to do this is in the description in human language of the parameter and the type of the return value:
function dupe(arr) { ... }
FYI, you can use Array.<number> , or Array<number> , or even number[] inside the @type .
If this feature is important to you (Id, of course, use it!), You can send a question .
source share