javascript classes constructors methods and objects