circulate over an javascript array