COnvertion of normal fn to arrow
by SriSri M
JavaScript
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."); }
);
function ask(question, yes, no) {
if (confirm(question)) yes()
else no();
}
ask("Do u asgree?",() => alert("u agreed"),() => alert("cancelled"));