String.match(regexp) JSDoc Oddity

string.match(regexp) returns an array of strings. So the proper JSDoc nomenclature should be @return{String}, but Servoy creates a warning marker:

[attachment=1]servoy_regex_match_1.png[/attachment]

Changing the JSDoc nomenclature to @return{String} makes the warning maker go away but is not correct.

[attachment=0]servoy_regex_match_2.png[/attachment]

Am I missing something?

It seems you are close. But the JSDoc notation in Servoy should not be

@return {String[]}

but

@return {Array<String>}

Well, that’s interesting, because I use {String} in JSDoc notation everywhere with no warning or error markers (except for the String.match(regex) expression). For example:

[attachment=0]servoy_regex_match_3.png[/attachment]

Why does JSDoc accept {String} notation in some cases but not in others? If {String} is improper notation, why is it not flagged everywhere as a warning or error? Why does String.match(regex) appear to be a special case for JSDoc? I do not mind changing to the other notation, but I would like to know the reason for it.

String, string, Array and Array are all synonyms, so doesn’t matter which one you use