Skip to content

In this repository, I have learned TypeScript at a basic level. This means that I have learned the key concepts of TypeScript that are commonly used in a codebase.

Notifications You must be signed in to change notification settings

harshsinghmumbai/TypeScript_language_Basic_level

Repository files navigation

Learn What matters in TypeScript lang(concepts which is maximum used codebase)

  
1. Type annotation 
 eg :- 
 let firstName : string = 45;
 let firstName : number = 45;
 let firstName : boolean = true;
 let firstName : undefined
   
  

  
2. Type Any & unknown both used in function (***parameter***)=>{...}
:Any = store any type of data without any type checking by the TypeScript compiler   
:unknown = best used when you don't know the type of data being typed. To add a type later
   
  

  
3.TypeScript function 
 function greet (value: number): string //compulsory// {
console.log("Hello"+ value)
}
greet(12:number) //compulsory//
  
  

  
4. Type Array in TypeScript
eg: 
const names : string [ ] = ["a", "b", "c", "d];
 
  

  
5. Type Object in TypeScript

interface CarProps { type: string model: string year: number } eg: const car = { type: "Toyota", model: "Corolla", year: 2009 };

About

In this repository, I have learned TypeScript at a basic level. This means that I have learned the key concepts of TypeScript that are commonly used in a codebase.

Topics

Resources

Stars

Watchers

Forks