Mintii's Dev Blog

What I'm learning about TypeScript

Tuesday Jan 9

Type Alias starts with the type keyword and then a name and then any type. It's a way to encapsulate how a value could have many types, but you only need to declare it once.

let rawData: boolean | number | string | null | undefined; 
// this could be refactored to a Type!

type RawData = boolean | number | string | null | undefined;
let rawData: RawData; 

#professional development #typescript