JSFiddle - React, Tailwind, and code Playground

JavaScript

var i = 0, result = "";

while (i++ < 20) {
    result += i + " ";

    // check to see if we're at 5/10/15/20 to add a new-line
    if (i % 5 === 0) {
        result += "\n" ;
    }
}

window.alert(result);