While Loop Multiple Conditions Javascript