Arraylist Methods In Javascript