Skip to content

Function expression and arrows #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ function ask(question, yes, no) {
}

ask(
"Do you agree?",
"Ви згодні?",
*!*
() => alert("You agreed."),
() => alert("You canceled the execution.")
() => alert("Ви погодились."),
() => alert("Ви скасували виконання.")
*/!*
);
```

Looks short and clean, right?
Тепер все коротко і зрозуміло, правда?
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Rewrite with arrow functions
# Перепишіть з використанням стрілкових функцій

Replace Function Expressions with arrow functions in the code:
Замініть Функціональні Вирази на стрілкові функції у коді:

```js run
function ask(question, yes, no) {
Expand All @@ -10,8 +10,8 @@ function ask(question, yes, no) {
}

ask(
"Do you agree?",
function() { alert("You agreed."); },
function() { alert("You canceled the execution."); }
"Ви згодні?",
function() { alert("Ви погодились."); },
function() { alert("Ви скасували виконання."); }
);
```
Loading