how the OOP in Javascript must be written