An open API service indexing awesome lists of open source software.

https://github.com/harshsinghmumbai/typescript_language_basic_level

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.
https://github.com/harshsinghmumbai/typescript_language_basic_level

annotations any-unknown generic interfaces typescript-arrays typescript-function typescript-objects

Last synced: 3 months ago
JSON representation

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.

Awesome Lists containing this project

README

          

# 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
};