10.arrow functions
by John Kiran
JavaScript
let ask = (question, yes, no) => {
if (confirm(question)) {
yes();
} else {
no();
}
}
ask("do you agree?",
() => { alert("you agreed"); },
() => { alert("you cancelled the execution"); });