Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
Well done!
You have completed Practice Getters and Setters in JavaScript!
You have completed Practice Getters and Setters in JavaScript!
Instruction
Creating a Getter Solution
Task 1 Solution
In the first task you were asked to add a getter method inside the Rectangle class that would calculate and return the value of a rectangle object's area. By using a getter method for this, we give users of our class the ability to change the value of a rectangle object's length or width without having to manually recalculate the rectangle's area. Another benefit is that ...