orangeTree class in JavaScript