I\'m trying to get the output from my for loop to print in a single line in the console.
for(var i = 1; i < 11; i += 1) { console.log(i); }
There can be an alternative way to print counters in single row, console.log() put trailing newline without specifying and we cannot omit that.
let str = '',i=1; while(i<=10){ str += i+''; i += 1; } console.log(str);