This commit is contained in:
Ilya Kantor 2017-03-21 17:14:05 +03:00
parent ab9ab64bd5
commit 97c8f22bbb
289 changed files with 195 additions and 172 deletions

View file

@ -0,0 +1,21 @@
<script>
function mul(a, b) {
return a * b;
};
function ask(question, answer, ok, fail) {
let result = prompt(question, '');
if (result.toLowerCase() == answer.toLowerCase()) ok();
else fail();
}
function bind(func, context /*, args*/) {
let bindArgs = [].slice.call(arguments, 2); // (1)
function wrapper() { // (2)
let args = [].slice.call(arguments);
let unshiftArgs = bindArgs.concat(args); // (3)
return func.apply(context, unshiftArgs); // (4)
}
return wrapper;
}
</script>