JavaScript, Functional Programming, Web Development, State Encapsulation, Javascript State.
attempting to directly change the field (i.e. x.myVal = 2) won’t do anything. The greatest part of having these explicit setters and getters is that the object now has a strong contract/interface with the outside world. The state is fully encapsulated and the only ways in and out of the object is