non centra, ma se vuoi ho una funzione in js come quella che vuoi che utilizza array...
se serve posto..