When I reviewed my colleague’s code today, I found that the end condition of the loop calls the array length every time I need to go through the array
It is recommended that you use the array length independent of the array length when using the for loop in the same scenario
Now let’s see how the two compare
Accessing the length of an array
The case where the array length is not accessed
Can YOU give me a like if it helps you