Home > Back-end >  (want to see, but still have some small problem) about using a for loop sequence table query element
(want to see, but still have some small problem) about using a for loop sequence table query element

Time:10-30


This is a for loop statement that do not add a semicolon, arguably should return the location query element
My order in the table 'x' position is 0, but the return value is:

According to its position is 120
But if after the for loop and the semicolon

Can return right 'x' position, why? Is I to the for loop is wrong?

Should not then compare conditions, if the data [I]=x output I? Why want to add a semicolon after the for loop to output the correct value? Hope someone can to nudge me, thanks a lot

CodePudding user response:

I vaguely seems to understand, but can't figure out why not add a semicolon will output 120

CodePudding user response:

reference 1st floor weixin_45806257 response:
I vaguely seems to understand, but can't figure out why not add a semicolon will output 120


I tried it on in the back of the element, if the return value is zero, that is a for loop will only perform? Is different from I thought "it performs to jump out of the for loop again before returning to jump out of the I end the value of the"
So this kind of "want to use the return value () function returns the content of the for loop to calculate the" have to manually make the value after the for loop to accept? If it is concluded that the return value directly in the for loop body will only return the value of the first cycle?
  • Related