Javascript Flatten Array Into Arraylist Contains Allium