javascript for of array index