javaScript OOP and HQC homework