Daily TS tips and answered questions

Joined March 2020
16 Photos and videos
Oh boy do I appreciate having optional chaining in #TypeScript
1
TypescriptTutor retweeted
20 Aug 2020
🥳🎉 TypeScript 4.0 is here! 🎉🥳 Read up on what's new and get it today! devblogs.microsoft.com/types…
50
2,200
5,399
What feature are you most excited in #Typescript v4? devblogs.microsoft.com/types…

1
Which go you use more often?
77% Interfaces
23% Types
22 votes • Final results
In your TS projects which do you prefer?
78% strict: true
22% strict: false
23 votes • Final results
1
Leave a comment with “why”
As of Typescript 3.7, you can use the “?.” syntax called “Optional Chaining” to safely navigate deep properties that might be undefined. typescriptlang.org/docs/hand…
2
10
Use an abstract class to define methods to be implemented in classes that extend it. Typescript will throw compiler errors if they aren’t implemented correctly. typescriptlang.org/docs/hand…
5
A nice little treat from Typescript 3.8, you can now export * as namespace! Check it out!
1
3
Have a hard time remembering the difference between for..in and for..of loops? for *in* iterated *IN*dexes for *of* iterates *o*bjects (or the elements of the iterable)
1
9
The “Parameters” built-in utility type returns a tuple type describing the arguments passed to a provided function signature. Any terms there you don’t understand? Just ask! There’s no such thing as a bad question. typescriptlang.org/docs/hand…
1
4
The “NonNullable” built-in utility type removes the possibility of `undefined` or `null` from a type. typescriptlang.org/docs/hand…
1
2
One more #TypescriptQuiz today! Which element does not belong in an array of the following type? Array<Record<string, string | number>>
33% { [1]: 1 }
4% { b: 2 }
59% { c: true }
4% { d : 'd' }
27 votes • Final results
2
The “Extract” built-in utility type filters only the types from the first that are included in the second argument. typescriptlang.org/docs/hand…
1
3
Here's my first ever #TypescriptQuiz! Name the built-in type that should replace the highlighted question marks. (Select your answer in the poll below)
3
1
8
Name the built-in type that should replace the highlighted question marks.
8% Extract
76% Pick
4% Select
12% Subset
74 votes • Final results
The “Exclude” built-in utility type removes all types from the first argument that match match the second argument. typescriptlang.org/docs/hand…
The “Omit” built-in uitility type is used to keep all properties of a given type *except* for the ones passed in the second argument. typescriptlang.org/docs/hand…
5
18
TypescriptTutor retweeted
If you're interested in TypeScript, go follow @TypescriptTutor immediately , they're just starting and I absolutely love the trend (?) of "Daily X tips"
3
10
The “Pick” built-in utility type is used for selecting a subset of keys from another type. Every key you want must be listed as the second argument. typescriptlang.org/docs/hand…
4
7