+ 3
When you use “<“ doesnt that mean that the value won’t go to 5?
5 Antworten
0
In loops it won't go to 5 (1,2,3,4,5), but it will loop 5 times (0,1,2,3,4), and if you use a returning function like this
[Javascript sample] :
x = 0;
function Y(){
if( x < 5 ){
x++;
Y();
} else { }
}
It will go to 5 but when you use this
[Javascript sample] :
for( i = 1; i < 5; i++ ){
document.write( i );
}
It will only go to 4 (1,2,3,4)
Edit: assuming you were talking about loops since it was in your tags list
+ 1
Yes, <5 means that if the loop cariable reaches 5 the loop will be exited.
0
Sir thank you so much for the answer. I appreciate it.
0
No problem
- 1
Yeah, it won't go to 5 and above but can go below than 5 to negative infinity