Add my solution to Javascript