In this article I’ll go over a few key highlights from the recent release of TypeScript 3.7. I’ll be looking at things through the lens of how they...
For further actions, you may consider blocking this person and/or reporting abuse
Does "Uncalled function check" has wrong screenshot? Because the screenshot show "declare" error instead of uncalled function check
Yeah... I think I cropped it to the wrong error. It should have read:
This condition will always return true since the function is always defined. Did you mean to call it instead?
I've made the edit.
I feel shame. Don't publish tired.
I think some of the examples are not in the right order. Nice otherwise :)
As in you'd like to see the functions reordered within the gists for readability?
Ya kind of
The gists don’t seem to be in the right order, as some of them don’t match the text surrounding them.
example for Nullish Coalescing doesn't really seem to explain why it's useful: "old way" would just be
var calculator = someCalculator || new Calculator();
I was also wondering what's the difference between those two and I've found it. Nullish Coalescing better handles cases when it comes to truthy/falsy values.
For example:
Same thing, but different result with Nullish Coalescing:
I personally hate the use of the
||
operator in this context, but that's mostly because my background is a C# one where I read the operator and think thatb
would be assigned totrue
sincea
and100
would both be evaluated as booleans.Obviously they wouldn't, but to me
??
is way more intuitive than the use of||
in this context.I thought I remembered something like this being the edge case where this was useful... Thank you, this seems like a better example!
Yessss I've been waiting for Optional Chaining and Nullish Coalescing so hard, thanks for writing this up and appearing on my newsfeed 🙌
I know. Almost every merge request I review in the JavaScript / TypeScript world I wish the committer had access to optional chaining.
The decalre keyword is not really a feature, but compatebility option with es class members
devblogs.microsoft.com/typescript/...
Some more details about why optional chaining is not so perfect thing
dev.to/macsikora/what-is-wrong-wit...