File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
1-js/02-first-steps/14-function-basics/1-if-else-required Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ importance: 4
22
33---
44
5- # Is "else" required ?
5+ # Ar "else" yra privalomas ?
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 ji prašo patvirtinimo per ` confirm ` ir grąžina rezultatą :
1010
1111``` js
1212function checkAge (age ) {
@@ -15,13 +15,13 @@ function checkAge(age) {
1515* ! *
1616 } else {
1717 // ...
18- return confirm (' Did parents allow you ?' );
18+ return confirm (' Ar tėvai leido ?' );
1919 }
2020*/ ! *
2121}
2222```
2323
24- Will the function work differently if ` else ` is removed ?
24+ Ar ši funkcija veiks kitaip, jei ` else ` bus pašalinta ?
2525
2626``` js
2727function checkAge (age ) {
@@ -30,9 +30,9 @@ function checkAge(age) {
3030 }
3131* ! *
3232 // ...
33- return confirm (' Did parents allow you ?' );
33+ return confirm (' Ar tėvai leido ?' );
3434*/ ! *
3535}
3636```
3737
38- Is there any difference in the behavior of these two variants ?
38+ Ar yra nors vienas šio varianto elgsenos skirtumas ?
You can’t perform that action at this time.
0 commit comments