started my solution for javascript