Implementation OOP principlesin JavaScript