Skip to content

Commit 71736f0

Browse files
authored
200%
1 parent 305f087 commit 71736f0

File tree

1 file changed

+8
-8
lines changed
  • 1-js/02-first-steps/14-function-basics/2-rewrite-function-question-or

1 file changed

+8
-8
lines changed

1-js/02-first-steps/14-function-basics/2-rewrite-function-question-or/task.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,25 @@ importance: 4
22

33
---
44

5-
# Rewrite the function using '?' or '||'
5+
# Perrašykite funkciją naudodami operatorių '?' arba '||'
66

7-
The following function returns `true` if the parameter `age` is greater than `18`.
7+
Ši funkcija grąžina `true`, jei parametras `age` yra didesnis nei `18`.
88

9-
Otherwise it asks for a confirmation and returns its result.
9+
Priešingu atveju klausiama `confirm' ir grąžinamas rezultatas.
1010

1111
```js
1212
function checkAge(age) {
1313
if (age > 18) {
1414
return true;
1515
} else {
16-
return confirm('Did parents allow you?');
16+
return confirm('Ar tėvai leido?');
1717
}
1818
}
1919
```
2020

21-
Rewrite it, to perform the same, but without `if`, in a single line.
21+
Perrašykite funkciją taip, kad ji darytų tą patį, bet be `if`, vienoje eilutėje.
2222

23-
Make two variants of `checkAge`:
23+
Sukurkite dvi funkcijos `checkAge` variantus:
2424

25-
1. Using a question mark operator `?`
26-
2. Using OR `||`
25+
1. Naudojant operatorių `?`
26+
2. Naudojant operatorių `||`

0 commit comments

Comments
 (0)