js testing for loop 2