Java Push Into Array Javascript Iteration