In this video, I have explained what is Type, Type Inference, Type Annotations in TypeScript.
Type Inference:
TypeScript has a feature called type inference, which allows the compiler to automatically determine the types of variables if you don't explicitly specify them.
For example, if you declare a variable and assign it a numeric value, TypeScript will infer its type as number without needing explicit type annotations.
Type inference helps reduce verbosity in your code while still providing type safety.
example:
let age = 30;
5. Type Annotations:
Type annotations in TypeScript involve explicitly specifying the types of variables, function parameters, and return values.
let age: number = 30;
let name: string = "John";
let isStudent: boolean = true;
Schedule a meeting in case of any queries/guidance/counselling:
calendly.com/n...
~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
www.youtube.co...
Follow me on my Facebook Page:
/ naveenqtpexpert
Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
t.me/joinchat/...
Naveen AutomationLabs Paid Courses:
GIT Hub Course:
naveenautomati...
Java & Selenium:
naveenautomati...
Java & API +POSTMAN + RestAssured + HttpClient:
naveenautomati...
Негізгі бет #2 - Type, Type Inference, Type Annotations in TypeScript
No video
Пікірлер: 8