OOP JavaScript homework