// interface => same as type alias => used for specificying the data types of objects (intoduced in newer version of TS) // always use ; not , interface personDT { name:string; age:number; city:string; } const person1:personDT = { name:"Hemant", age:24, city:"Chhatarpur" } function greet1(person:personDT){ console.log("Hello, " + person.name); } greet1(person1); // interface Product { name:string; price:number; quantity:number; } const product1:Product = {name:"pencil",price:5,quantity:5} function calculateTotalPrice (product:Product):number { return product.price * product.quantity; } console.log(calculateTotalPrice(product1));
🔗 Download Source Code & Homework: thapatechnical.shop/courses/typescript-crash-course
Best series of Typescript on TH-cam
Namikaze Minatoo❤🔥❤🔥🔥
Sir Dil se aap ko thanks 😍
Every thing mush know about TS is here...
thansx again Sir. 🤗
clearing many doubts 😊
Glad to hear that
Vercel m login krne m user block error aa raha h. Ye issue kaise resolve hoga...?
// interface => same as type alias => used for specificying the data types of objects (intoduced in newer version of TS)
// always use ; not ,
interface personDT {
name:string;
age:number;
city:string;
}
const person1:personDT = {
name:"Hemant",
age:24,
city:"Chhatarpur"
}
function greet1(person:personDT){
console.log("Hello, " + person.name);
}
greet1(person1);
//
interface Product {
name:string;
price:number;
quantity:number;
}
const product1:Product = {name:"pencil",price:5,quantity:5}
function calculateTotalPrice (product:Product):number {
return product.price * product.quantity;
}
console.log(calculateTotalPrice(product1));
It was awesome
bro how to use interfaces with promise function as an array[] ,,,,,,,
interface Product {
name: string;
price: number;
quantity: number;
}
const myProduct: Product = {
name: "Laptop",
price: 1899,
quantity: 3
}
function calculateTotalPrice(product: Product): number {
return product.price * product.quantity;
}
💙💜
If u have to use same named variables in several files then just write in your code
export {}
Just fine
Thank bolne ki jarurat nahi 😂hai
🔥
🙏👍
I am yha tk pahuch gya hu girte padte congretesme
❤❤op😊
For the sake of the study, please do not mention your website or the introduction to a prior video in every video. 😐😐😐😐