Сообщение от Sergey69
|
for(var keyA in answer)
|
Sergey69,
function test () {
var secret = {
secret1 : "1+1",
secret2 : "2+2",
secret3 : "3+3"
};
var answer = {
secret1 : 2,
secret2 : 4,
secret3 : 6
};
var otvet, countYes = 0, countNo = 3;
for (var keyS in secret) {
otvet = +prompt(secret[keyS]);
if (otvet == answer[keyS]) {
alert("Верно");
countYes++;
countNo--;
} else alert("Неверно");
}
alert("Верных ответов: " + countYes);
alert("Неверных ответов: " + countNo);
}
test();