Java script oop