refactor types

This commit is contained in:
Ilya Kantor 2015-03-21 16:48:12 +03:00
parent 0712ddc698
commit c108f03596
10 changed files with 69 additions and 438 deletions

View file

@ -415,15 +415,9 @@ function mul(a, b) {
return a * b;
};
function ask(question, correctAnswer, ok, fail) {
var result;
if (typeof correctAnswer == 'boolean') {
result = confirm(question);
} else {
result = prompt(question, '');
}
if (result == correctAnswer) ok()
function ask(question, answer, ok, fail) {
var result = prompt(question, '');
if (result.toLowerCase() == answer.toLowerCase()) ok();
else fail();
}