loop increment incrorrect

loop increment incrorrect

the problem i'm having with this loop is when selecting 2 files in the input the files gets read with the read_file function, then when debugging my var id it always shows up as 2.

as the id is increasing while in the loop i expect a result of 0, 1 or 1, 2 (maybe) =/

here is my fiddle if someone can please tell me what is happening here.

https://jsfiddle.net/7ume34ea/1/

thank you