object oriented javascript practice