TypeScript | TypeScript Object Oriented Programming | Question5

Last Updated :
Discuss
Comments

Which of the following is a correct example of a getter method in TypeScript?

getProperty { return this.property; }

get getProperty() { return this.property; }

getter getProperty() { return this.property; }

function getProperty() { return this.property; }

Share your thoughts in the comments