For loop of get node at

what if in the for loop the i varrible will be initialised from 0 and will terminate at i < intex.

will this work fine i tried and it was working fine but didnt know about all test cases

yes, that should work fine