02 / 03

What are getter and setter functions?

  1. 1

    getter: This method comes when you want to access any property of an object. A getter is also called an accessor.

  2. 2

    setter: This method comes when you want to change any property of an object. A setter is also known as a mutator.

javascript