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);
}
Right now it's
1
2
3
4
5
6
7
8
9
10
How can I get the output all in one line (like this
1 2 3 4 5 6 7 8 9 10
)?
console.log(i);
just domyvar = myvar + '' + i;
and athe end of your loopconsole.log(myvar);