Javascript Foreach Create Arraylist With Size