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.
- Host: GitHub
- URL: https://github.com/harshsinghmumbai/typescript_language_basic_level
- Owner: harshsinghmumbai
- Created: 2024-06-06T14:51:15.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-14T16:18:27.000Z (over 1 year ago)
- Last Synced: 2025-01-30T05:43:31.266Z (11 months ago)
- Topics: annotations, any-unknown, generic, interfaces, typescript-arrays, typescript-function, typescript-objects
- Language: TypeScript
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
};