0
<script>
var i = 0;
while(i < 100){
n = 1;
resultado = n + i;
if(0 === (i%10)){
document.write(n + '-' + resultado + '<br>');
}else{
document.write(n + '-' + resultado + ' ');
}
i++;
}
</script>
I’m typing this code for an exercise, and it’s still part of what I want to do, but I found a problem, he’s giving the if command to jump the line before the time, it was only supposed to be in the 1-10, but he does it in 1-1, I hope you can understand, I’m sorry if I expressed myself badly, but I’m starting to study this area now, thanks!
I tried to change var i for 1 and even so, now it break on line 1-11 not on line 1-10 as I would like.
– Mauricio Junior
Zero gives true at "0 === 0 % 10" you have to add "&& i > 0". You want there to be line break every 10 right?
– Sergio