Answer the question
In order to leave comments, you need to log in
How to put a limit on the index of an array in a loop?
there is an array p = [....];
There is such a code
for(b=0;b<p.length;b++){
var y = p[b];
if(y <= ?? && y > 0){
d++
}
}
Answer the question
In order to leave comments, you need to log in
determine the desired index, and put it instead of p.length in the loop condition
Write in the condition a restriction not on the value of the array cell, but on the index. That is, if( b <= 1 )
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question