In today's lesson, we look at getters and setters in Javascript ES6 syntax. The purpose of getters and setters is to allow other users to obtain or get, values as well as change, or set, values of properties within objects. We are about to create a class object and construct it according to what we specify in the get and set part of our class. In the constructor part of the class, we specify the properties the object will have, and when we create our class, those properties will be a part of it. The purpose of the getter and setter is to only allow users to access the get and set functions and not direct access to the private variables. Understanding classes is vital for this javascript tutorial and I recommend starting this course from the beginning if you are having trouble. Understanding function declarations and syntax is important as well and you may want to review some of our Javascript tutorials if you are having trouble remembering basic Javascript syntax.
Check out weWillCode.com/courses to access all courses for free. We Will Code is here to help you if you have any questions. Comment through Youtube or Facebook by searching for "We Will Code".