JavaScript | JavaScript Objects | Question 8

Last Updated :
Discuss
Comments

Which of the following is a valid getter in an object?

get name() { return this._name; }

getter name() { return this._name; }

get: function() { return this.name; }

name.get { return this._name; }

Share your thoughts in the comments