我现在正在尝试一段时间并让它变得完美。我正在尝试简化我创建的这个for 循环并使其实际工作,没有任何数组,只有最基本的基本 JavaScript。
for (var x=0;x<=1;x++) {
if (secondInput == luckyNumber || secondInput == luckyNumber2 || secondInput == luckyNumber3) {
if (thirdInput == luckyNumber || thirdInput == luckyNumber2 || thirdInput == luckyNumber3) {
if (firstInput == luckyNumber || firstInput == luckyNumber2 || firstInput == luckyNumber3) {
while (firstInput !== secondInput){
while(firstInput !== thirdInput){while(secondInput !== thirdInput) {
alert('Congratulations! You got all 3 numbers correct. You\'ve won £1,000!');
}
}
}
}
}
}
这段代码有意义还是我做错了什么?我有一种感觉,我什至可以离开循环,但这是我认为它是正确的唯一方法。