We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
TypeScript Version: 2.3.4
Code
const foo = (bar?: { baz: number }) => { if (bar == null) { bar = { baz: 0 }; } const baz = () => { console.log(bar.baz); // Object is possibly undefined }; baz(); };
Playground link
Expected behavior: No error
Actual behavior: Error "Object is possibly undefined"