created while loop js file