-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
🔎 Search Terms
jsdoc optional parameters
🕗 Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about jsdoc. It seems the intention is to support this behavior, per the handbook -- jsdoc supported types listing it as an example.
⏯ Playground Link
💻 Code
/**
* @param {string} p1 - A string param.
* @param {string=} p2 - An optional param (Google Closure syntax)
* @param {string} [p3] - Another optional param (JSDoc syntax).
* @param {string} [p4="test"] - An optional param with a default value
* @returns {string} This is the result
*/
function stringsStringStrings(p1, p2, p3, p4) {
p3
}🙁 Actual behavior
Within the definition of stringsStringsStrings(), p3 has an incorrect type of string.
🙂 Expected behavior
The parameter is optional, the type should be string | undefined.
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code