Interface in TypeScript | Object with Interface

preview_player
Показать описание
Learn TypeScript with Me.
We will teach you TS(TypeScript) from from scratch.

This is our 17th Video of TypeScript

TypeScript is a free and open source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript and adds optional static typing to the language. It is designed for the development of large applications and transpiles to JavaScript. As it is a superset of JavaScript, existing JavaScript programs are also valid TypeScript programs.

If you have a basic knowledge JavaScript then it should be very helpful.

Put your comments and share your experience with me, if you like this video.
Also if you have any suggestions then please suggest them in the comment box.

TypeScript Tutorial 2023 Playlist

Modern JavaScript ES6 Tutorial 2023 Playlist

Java Beginners Tutorial 2023 Playlist

OOPS Playlist

Like | Share | Comment | Subscribe

Follow Me On Social Media.

#javascript #modernjavascriptes6 #es6tutorial2023 #modernjstutorial2023 #way2future
Рекомендации по теме
Комментарии
Автор

13:50 you can use below code for array you should use index signature for object only
interface inter {
name:string,
age:number,
isEmployee:boolean,
workHours: number[], // array
otherDetails: {[index:string]: string}, // object : index signature
working: ()=>string
}

let obj:inter = {
name: "Dhruvil",
age: 22,
isEmployee: true,
workHours: [7, 8, 9],
otherDetails: {
dob: "18/08/2002"
},
working: () => {
return "Working ...";
}
}
console.log(obj.name);
console.log(obj.age)
console.log(obj.workHours);

console.log(obj.working());

dhruvilkumar
welcome to shbcf.ru