update javascript arraylist