#21: TypeScript Interface - Defining Contracts for Objects & Classes 📝

preview_player
Показать описание
Welcome, Interfaces in TypeScript provide a blueprint or contract for objects and classes, specifying the required properties and methods that must be implemented by any object or class that implements the interface.

😊 Become Member, get access to perks, free Source code, & more..

🕒 Timeline:

00:00 - Introduction

00:20 - Representing Objects in TypeScript: 3 Different Approaches

01:40 - Interface vs. Type Alias in TypeScript

02:40 - What is an Interface?

04:00 - Practical Interface Example

06:30 - How to Access Source Code

07:30 - Real-Life Example of Interface Usage

************* 😍 Must Watch Videos For Web Development 😍 *************

Рекомендации по теме
Комментарии
Автор

Sir Dil se aap ko thanks 😍
Every thing mush know about TS is here...
thansx again Sir. 🤗

trashfiles
Автор

*Interface is nothing, you only have to use 'interface' keyword in place of 'type' like what we've done in "type Alises". Also we don't need to use any equal to sign (=) and BOOM that's it!! It acts very similar to type Alises but just a newer version of it.*

Yamamoto_Chiko
Автор

Vercel m login krne m user block error aa raha h. Ye issue kaise resolve hoga...?

priyasharma
Автор

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


hemantvishwakarma
Автор

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

zakidev
Автор

bro how to use interfaces with promise function as an array[]

MuhammadAdnan.
Автор

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

_PRANAYMATE
Автор

I am yha tk pahuch gya hu girte padte congretesme

nikhild
Автор

For the sake of the study, please do not mention your website or the introduction to a prior video in every video. 😐😐😐😐

abhipathania
visit shbcf.ru