got 'Property is always "undefined"' when it's not always "undefined"
See original GitHub issuetype AA = {
a:? number,
b:? number,
c:? string,
}
const a: AA = {};
if(a.a !== undefined && a.b !== undefined && a.c !== undefined) {// error: Property is always "undefined"
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Angular ngOnInit the object property is always undefined ...
I have an angular project and currently I am trying to set a reactive form values on ngOnInit method. I get the data...
Read more >7 Tips to Handle undefined in JavaScript - Dmitri Pavlutin
The short answer is that JavaScript interpreter returns undefined when accessing a variable or object property that is not yet initialized.
Read more >undefined - JavaScript - MDN Web Docs - Mozilla
The global undefined property represents the primitive value undefined. It is one of JavaScript's primitive types.
Read more >JavaScript undefined
The undefined is a primitive type that has a single value undefined . · Accessing an uninitialized variable returns undefined . · Accessing...
Read more >Documentation - TypeScript 2.0
In strict null checking mode, the null and undefined values are not in the domain of every type and are only assignable to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Do you guys like Flow better than TypeScript? (Just curious)
TypeScript seems to have higher usage, so if Hegel syntax is more aligned with TS, then easier for people to migrate to and adopt Hegel.
That’s interesting (and sorry, off topic), the syntax
c:? string,
doesn’t seem to be compatible with TS (not sure if that’s a goal). In TS it isc?: string,
(example).