As of Typescript 3.7, you can use the “?.” syntax called “Optional Chaining” to safely navigate deep properties that might be undefined.
https://t.co/mtLeQCJO5d
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.
https://t.co/W5gwGoYWJH
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)
@setfloat@aaronfrost@typescript@angular Got it! The “!” is applied to the final result (either baz or undefined)
Exactly the same as !https://t.co/OrgOnroBZq.baz would (without throwing an error if foo or bar are undefined)
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.
https://t.co/pmq8Y49jh1
@BryanMigliorisi@SeaRyanC@drosenwasser I can’t explain *why* this is. But when I use arrow functions (particularly for the first function) the inference is working for me.
inferenceDoesntWork({
firstFunction: () => true,
secondFunction: a => a,
}),