TypescriptTutor's profile picture. Daily TS tips and answered questions

TypescriptTutor

@TypescriptTutor

Daily TS tips and answered questions

Oh boy do I appreciate having optional chaining in #TypeScript


TypescriptTutor reposted

🥳🎉 TypeScript 4.0 is here! 🎉🥳 Read up on what's new and get it today! devblogs.microsoft.com/typescript/ann…

typescript's tweet image. 🥳🎉 TypeScript 4.0 is here! 🎉🥳

Read up on what's new and get it today!

devblogs.microsoft.com/typescript/ann…

Which go you use more often?

Interfaces %77.3
Types %22.7

22 vote · Final results


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/handbook/…

TypescriptTutor's tweet image. 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/handbook/…

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/handbook/…

TypescriptTutor's tweet image. 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/handbook/…

A nice little treat from Typescript 3.8, you can now export * as namespace! Check it out!

TypescriptTutor's tweet image. A nice little treat from Typescript 3.8, you can now export * as namespace! Check it out!

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)

TypescriptTutor's tweet image. 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)

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/handbook/…

TypescriptTutor's tweet image. 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/handbook/…

The “NonNullable” built-in utility type removes the possibility of `undefined` or `null` from a type. typescriptlang.org/docs/handbook/…

TypescriptTutor's tweet image. The “NonNullable” built-in utility type removes the possibility of `undefined` or `null` from a type.

typescriptlang.org/docs/handbook/…

One more #TypescriptQuiz today! Which element does not belong in an array of the following type? Array<Record<string, string | number>>


The “Extract” built-in utility type filters only the types from the first that are included in the second argument. typescriptlang.org/docs/handbook/…

TypescriptTutor's tweet image. The “Extract” built-in utility type filters only the types from the first that are included in the second argument.

typescriptlang.org/docs/handbook/…

The “Exclude” built-in utility type removes all types from the first argument that match match the second argument. typescriptlang.org/docs/handbook/…

TypescriptTutor's tweet image. The “Exclude” built-in utility type removes all types from the first argument that match match the second argument.

typescriptlang.org/docs/handbook/…

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/handbook/…

TypescriptTutor's tweet image. 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/handbook/…

TypescriptTutor reposted

If you're interested in TypeScript, go follow @TypescriptTutor immediately , they're just starting and I absolutely love the trend (?) of "Daily X tips"


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/handbook/…

TypescriptTutor's tweet image. 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/handbook/…

This account does not follow anyone
Loading...

Something went wrong.


Something went wrong.