When I'm running this I'm getting the following error:
Expected an assignment or function call and instead saw an expression.
var dealer1 = 8;
var dealer2 = 4;
var dealer3 = 6;
var total2 = dealer1+dealer2+dealer3;
if (total2 < 17) {
ANSWER = 'safe';
}
else if (total2 = 21) {
ANSWER = 'black jack';
}
else (total2 >= 17 && total2 < 21); {
ANSWER = 'stop';
}
It's coming from this: else (total2 >= 17 && total2 < 21) and I can't figure out whats wrong with this!
Is this not correct?
Elsehas no condition. It simply covers all other possibilities that yourifandelse ifdon't.