why not use ....i<arr.length here??