코드가 작동하지 않아서 Chrome 콘솔을 사용하여 해결했으며 지금은 while
루프를 실행하면 undefined
을 반환합니다.while 루프가 루프에서 아무것도하지 않습니다.
let total = 0;
let playerTotal = 0;
while(total >= 10){
if (total >= 10){
if (total > playerTotal){
console.log('total wins')
} else if(total == playerTotal){
console.log('tie')
} else {
console.log('player wins')
}
}
total += 1
}
Typo :'total> = 10'은'total <= 10'이어야합니다. – Cerbrus
합계가 10보다 크거나 같지 않으므로 그 값은입니다. 값이 10과 10보다 큰 경우 ... 10,11,12,13을 ... – Fida