my solution for js-assessment