Javascript Foreach Create Arraylist With Values