javascript push object into array at index