If I understand your doubt, while
will rotate several times, while the j
is GREATER than 50, as it is divided this number will decrease, when it is equal to or less than 50 o while
will stop.
The console.log
is to know the current value of the j
each cycle of while
, for example, without the while
you would have something like:
j = 1928182;
console.log(j);
j /= 5;
console.log(j);
j /= 5;
console.log(j);
j /= 5;
console.log(j);
j /= 5;
console.log(j);
j /= 5;
console.log(j);
j /= 5;
console.log(j);
j /= 5;
console.log(j);
j /= 5;
It would be similar to doing this:
j = 1928182;
while (j > 50) {
console.log(j);
j /= 5;
}
The same results were shown, i.e. console.log
is to know what value will be divided, probably to analyze the process step by step.
Recalling that the console.log
is a function to be used with the tools:
- Chrome Devtools
- Microsoft Developer tools
- Firefox Developer Tools
and similar (such as browser-dependent javascript engine console)
@rd_1999 for being a sequential and interpreted language. On this.log() console of yours, the output result would be the value (number) being divided by 50.
– Vinícius
is that for example, CSS uses type in cascade format right? I’m asking if you don’t need to sort it out "in an order", because I gave the command to appear on the console, before J split by 5
– rd_1999