2
What I want to know is how I can make a rising counter in pure Javascript 0 , 1 , 2 , ...
I want something automatic, infinite without needing an arrow an integer or negative number
Counting can start from 0 or 1 onwards ...
Example
</script>
var min = 0
var max = 9
for (var i = min; i < max; i++) {
var seq = i/0;
document.getElementById('num').innerHTML += i
}
<script>
<body>
<span id='num'> </span>
</body>
That’s right, but I wanted to let loose, successively 1 2 3 4 5 6 8 9 ... Would have how, reuse this your routine to leave us as?
– Diego Henrique
Sure, I’ll edit @Diegohenrique
– Miguel
It was really good. We used the reserved word const, to achieve that objective.
– Diego Henrique
@Diegohenrique that you use if you know that the value of the variable will not change throughout the program, but uses
var
. In this case it would still work withvar
– Miguel