Reach the goal coded in Javascript