javascript for loop new line when getting to the end of screen

Solutions on MaxInterview for javascript for loop new line when getting to the end of screen by the best coders in the world