krijanprajapati.com.npUnion in TypescriptUnion in typescript allows the variable to hold more than one type of value. It is useful when variable can be of various types. It is defined by | operator between types. //Simple Union let randomValue:string|number=12; randomValue="John Doe"; //ran...Jul 13, 2024·1 min read
krijanprajapati.com.npDiscussion on Type Annotations and Type InferenceType Annotations: Type Annotations is used to define the types of variable, function parameters, return values and object properties.Example: // Variables let value:string="Hello My Name is John Doe"; let secondValue:number=12; secondValue=12-1; // ...Jul 12, 2024·1 min read
krijanprajapati.com.npIntroduction to TypescriptTypescript is basically superset to JavaScript. Typescript allows us to determine types of variables, function parameters, and return values that helps us to catch type-related errors during compile time. Typescript enables developers to catch errors...Jul 11, 2024·2 min read
krijanprajapati.com.npThings to learn when you are starting new in TypescriptThis is step by step topics that you should learn if you are starting new in typescript: Introduction to Typescript Typescript Annotations Type Inference Union Type Type any Using Typescript in Arrays Using Typescript in Objects Using Typescr...Jul 9, 2024·1 min read