Support optional private prop?
See original GitHub issueclass A{a(){obj?.#x.a}}
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
How to Deal with Optional Things and "Undefined" in TypeScript
First, if you don't tell TypeScript that a property is optional, it will expect it to be set. Adding ? to the property...
Read more >Optional property class in typescript - Stack Overflow
Optional property : In Typescript you can declare a property in your interface which will be optional. Suppose you have a interface for ......
Read more >Optional chaining (?.) - JavaScript - MDN Web Docs - Mozilla
The optional chaining ( ?. ) operator accesses an object's property or calls a function. If the object accessed or function called is ......
Read more >Add Support for Optional Bean Properties · Issue #399 - GitHub
Currently, a config bean cannot define a property which is optional, in the sense that it need not necessarily have a value.
Read more >Optional Chaining: The ?. Operator in TypeScript
We can use optional chaining to descend into an object whose properties potentially hold the values null or undefined without writing any null ......
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
In short, there were lots of arguments like ours. But it’s in the proposal now.
Private class fields and methods
Issue #28: Should optional chains support the upcoming private class fields and private methods, as in a?.#b, a?.#b() or a?.b.#c? Quoting microsoft/TypeScript#30167 (comment):
This one isn’t baked into the proposal yet, simply because private fields themselves aren’t baked yet. So we don’t want to hold up this proposal if that one happens to stall out. Once that one has reached Stage 4, we will address it then.
https://github.com/tc39/proposal-optional-chaining/issues/28 https://github.com/tc39/proposal-class-fields/pull/301 https://github.com/tc39/proposal-class-fields/pull/302