We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"undefined", "void", "optional", "no arguments", "rules"
No response
const fn1= (param: undefined | number) => {} const fn2 = (param: undefined | number) => {}
fn1(undefined) // success fn1() // fail fn2(undefined) //success fn2() // success
fn1(undefined) // success fn1() // success fn2(undefined) //success fn2() // success
The text was updated successfully, but these errors were encountered:
This is what optional parameters are for
const fn1 = (param?: number) => {}; fn1(undefined); // works fn1(); // also works
Sorry, something went wrong.
Duplicate of #12400
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
π Search Terms
"undefined", "void", "optional", "no arguments", "rules"
π Version & Regression Information
β― Playground Link
No response
π» Code
π Actual behavior
π Expected behavior
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: