What is an interface in typescript?



What is an interface in typescript?..

Answer / Anjana Sachan

An interface in TypeScript is a way to define a structure for an object. It can be used to ensure that an object has certain properties and that these properties have the correct type. For example: `interface Person { name: string; age: number; }`

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More TypeScript Interview Questions

Can we use jsx in typescript?

1 Answers  


What is typescript? What is the need for it in angular2?

1 Answers  


How to declare variable in typescript?

1 Answers  


What are the disadvantages of typescript?

1 Answers  


What is getters and setters in typescript?

1 Answers  


Tell the minimum requirements for installing typescript. Also, mention the steps involved in it.

1 Answers  


How to create fields, constructor and function in typescript class?

1 Answers  


What are the variables in typescript? How to create a variable in typescript?

1 Answers  


Is angular typescript?

1 Answers  


How to create a variable in typescript?

1 Answers  


What is declaration merging?

1 Answers  


What is typescript declare keyword?

1 Answers  


Categories