refactor types
This commit is contained in:
parent
0712ddc698
commit
c108f03596
10 changed files with 69 additions and 438 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue