The __________ keyword is used for creating getter methods in an ES6 class.

  • Set
  • Get
  • Define
  • Getter
In ES6 classes, the get keyword is used to create getter methods. Getter methods allow you to retrieve the value of an object's property. When a getter method is defined using the get keyword, it is called without the need for parentheses, providing a more natural and property-like syntax when accessing the property.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *