Update main.js

Don not add a new line at the end of the iteration.