7. Array Types in Typescript. Define the types of the array as [] in the typescript

preview_player
Показать описание
Hi Friends
In this video, we will see how to define the types for the arrays in the typescript.

If you like this video, please subscribe to my channel.
Рекомендации по теме
Комментарии
Автор

Hi freind. Thanks a lot for this great video. I want to know, what is the difference between keywords let and var

lenigaussgauss
Автор

you can write a function like this function printProperty<T, K extends keyof T>(object: T, key: K) { let propertyValue = object[key] }

mohtadibakali
Автор

Hi Leela,

Thanks for the tutorial.

Small clarification,

We are looping person.hobbies (only the string array inside the object). But, inside the loop when I try to access person.name, I'm able to access the values.

for (let hobby of person.hobbies) {
console.log('hobby', hobby);
console.log('person', person.name);
}

It's an advantage or disadvantage?

Could you please clarify.

Thanks

amarnath