en.javascript.info/1-js/02-first-steps/16-arrow-functions-basics/1-rewrite-arrow/task.md
2019-11-06 14:05:43 +03:00

17 lines
320 B
Markdown

# Rewrite with arrow functions
Replace Function Expressions with arrow functions in the code below:
```js run
function ask(question, yes, no) {
if (confirm(question)) yes()
else no();
}
ask(
"Do you agree?",
function() { alert("You agreed."); },
function() { alert("You canceled the execution."); }
);
```