Encapsulation in javascript - method 3/3