Why Use Arraylist Over Array In Javascript Functions