Javascript Javascript Basic Iterator