js oop exam - my solution