en.javascript.info/1-js/02-first-steps/17-arrow-functions-basics/1-rewrite-arrow/task.md
2021-03-15 06:48:10 +05:30

321 B

Rewrite with arrow functions

Replace Function Expressions with arrow functions in the code below:

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."); }
);