Print all odd numbers from 0 to 100000 My teacher gave me a simple problem which I should solve with a code tiny as possible. I should print all odd numbers from 0 to 100000 into a HTML document using javascript.

for(var y = 0; y &lt; 100000; y++){
if(!(y % 2 == 0)){
document.write(y + " ");
}
};


Is it possible to do that shorter?
JavaScript, 38 bytes

Yet another way to do this, shortest of all.

This supposedly prints each number on a new line using \n. Now as the data is being written to an HTML document, \n is not of any use and the numbers appear to be separated by space only.



for(i=1;i&lt;1e5;i+=2)document.writeln(i)