Arraylist Integer New Array Javascript Function