if (isLastAnswer || !isRightAnswer) { userAnswers = []; alert(isRightAnswer ? 'Правильно' : 'Неправильно'); if (isRightAnswer) { location.href = 'TestDKS2.html' } else { location.href = location.href; } }