Update Javascript arrays