It's probably worth mentioning that TypeScript don't have support for this feature yet (AFAIK), so could lead to some IDE 'errors'.
There is also no plugin to add them into TS support syntax checking yet, so we have to live with the errors or disable TS checks.
Thanks for mentioning this!
I don't work with TS that often but I think at some point they will support it :)
does TS support babeljs? if yes maybe they can work together right now? 🤔
I'm pretty sure typescript has something like this ... I know because my last angular project came to a point where I used the ? in a way similar to this to disambiguate values extracted from defined types in the app. Nothing major (it was my first project) but I definitely remember finding usage of "?" as a means of testing type attributes without using a long if condition with explicit null checking. I'll have to confirm by looking at my project code.
Are you maybe referring to Ternary operators?
Interestingly enough today at work I opened up the project in question and was unable to find where I used the "?" in the typescript. I think it may have been in an html file using an ng directive but had to switch off to other work before I finalized my search.
You could be right...I'll confirm again tomorrow.
Neither do I but it's what drives the syntax support in Visual Studio Code :)
Not for what I'm talking about, no. Whether TS and Babel can work, when writing TS, is a question for someone that uses TS :)
Ahh okay yeah, that's true!
VSC will show an error if you don't configure it!
I just got used to seeing the error 🤣
They plan to add it in TS 3.7.0! 😁
Nice I really need to try TS at some point :)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.