oop of a plant using javascript