function foo(a, opt_b) {
opt_b = opt_b || 1;
...
}
foo(1); // IntelliJ will yell at me, saying "Invalid number of parameters, expected 2"
Is there a way to document foo() such that IntelliJ won’t yell at me?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Using JavaDoc-style comments for JavaScript, you can declare a parameter as optional with brackets [] around it: