- Notifications
You must be signed in to change notification settings - Fork7
Translated the if statements#77
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
24 commits Select commitHold shift + click to select a range
5154490
Update article.md
meilunef48ad01
Update article.md
meilune1ebf783
Translated article.md
meilune063cf63
Translated task.md
meilune673d6a1
Translated solution.md
meilune3cec1b7
Translated task.md
meilune2320cff
Translated solution.md
meilunea0acd3d
Translated task.md
meilunea85d7ad
Translated solution.md
meiluneda3283a
Translated task.md
meilune535e08c
Translated solution.md
meiluned8bc382
Translated task.md
meilune419f3a4
Translated solution.md
meilune50143ee
Translated task.md
meiluneb4be9ee
Translated task.md
meilune4bcffb3
Translated solution.md
meilune7fa2669
Translated task.md
meilunef8cb281
Translated solution.md
meiluneb040cb7
Translated task.md
meilunebffa68d
Translated solution.md
meilunee1323a7
Translated ifelse_task.svg
meilune46f8d2c
Translated ifelse_task.svg
meilune360ba37
Translated ifelse_task.svg
meilunea4518ed
Translated ifelse_task.svg
meiluneFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Atsakymas yra`2`,pirmojitruthyvertė. | ||
```js run | ||
alert( null || 2 || undefined ); | ||
4 changes: 2 additions & 2 deletions1-js/02-first-steps/11-logical-operators/1-alert-null-2-undefined/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions1-js/02-first-steps/11-logical-operators/2-alert-or/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
Atsakymas yra: pirma `1`,tada `2`. | ||
```js run | ||
alert( alert(1) || 2 || alert(3) ); | ||
``` | ||
Šaukimas`alert`negrąžina jokios vertės. Arba kitaip sakant, jis grąžina `undefined`. | ||
1.Pirmasis ARBA`||`įvertina kairėje esantį operandą `alert(1)`.Jis parodo žinutę su `1`. | ||
2. `alert`grąžina `undefined`,tad ARBA eina prie sekančio operando ieškodamastruthyvertės. | ||
3.Antrasis operandas`2`yra truthy,tad operacija sustabdoma, grąžinamas`2`ir parodomas per išorinį alert. | ||
Nebebus`3`,nes įvertinimas nepasiekia `alert(3)`. |
4 changes: 2 additions & 2 deletions1-js/02-first-steps/11-logical-operators/2-alert-or/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Atsakymas: `null`,nes tai yra pirmoji falsyvertė sąraše. | ||
```js run | ||
alert( 1 && null && 2 ); | ||
4 changes: 2 additions & 2 deletions1-js/02-first-steps/11-logical-operators/3-alert-1-null-2/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,9 +2,9 @@ importance: 5 | ||
--- | ||
#Koks yra IR rezultatas? | ||
Ką parodys žemiau esantis kodas? | ||
```js | ||
alert( 1 && null && 2 ); | ||
6 changes: 3 additions & 3 deletions1-js/02-first-steps/11-logical-operators/4-alert-and/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
Atsakymas: `1`,ir tada `undefined`. | ||
```js run | ||
alert( alert(1) && alert(2) ); | ||
``` | ||
Šaukimas`alert`grąžina `undefined` (tiesiog parodo žinutę, tad nebus prasmingo grąžinimo). | ||
Dėl to`&&`įvertina kairį operandą (parodo `1`),ir iš karto sustoja, nes `undefined`yrafalsyvertė. O `&&`ieškofalsyvertės ir ją grąžina, ir sustoja. | ||
4 changes: 2 additions & 2 deletions1-js/02-first-steps/11-logical-operators/4-alert-and/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions1-js/02-first-steps/11-logical-operators/5-alert-and-or/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
Atsakymas: `3`. | ||
```js run | ||
alert( null || 2 && 3 || 4 ); | ||
``` | ||
IR`&&`pirmenybė yra aukštesnė už`||`,tad jis įvykdomas pirmiau. | ||
Rezultatas yra`2 && 3 = 3`,tad išraiška tampa: | ||
``` | ||
null || 3 || 4 | ||
``` | ||
Dabar rezultatas yra pirmojitruthyvertė: `3`. | ||
4 changes: 2 additions & 2 deletions1-js/02-first-steps/11-logical-operators/5-alert-and-or/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -2,9 +2,9 @@ importance: 5 | ||
--- | ||
#ARBA IR ARBA rezultatas | ||
Koks bus rezultatas? | ||
```js | ||
alert( null || 2 && 3 || 4 ); | ||
6 changes: 3 additions & 3 deletions1-js/02-first-steps/11-logical-operators/6-check-if-in-range/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions1-js/02-first-steps/11-logical-operators/7-check-if-out-range/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
Pirmas variantas: | ||
```js | ||
if (!(age >= 14 && age <= 90)) | ||
``` | ||
Antras variantas: | ||
```js | ||
if (age < 14 || age > 90) | ||
6 changes: 3 additions & 3 deletions1-js/02-first-steps/11-logical-operators/7-check-if-out-range/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions1-js/02-first-steps/11-logical-operators/8-if-question/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
Atsakymas: pirma ir antra bus įvykdytos. | ||
Details: | ||
```js run | ||
//Paleidžiama. | ||
//Rezultatas iš -1 || 0 = -1, truthy | ||
if (-1 || 0) alert( 'pirmas' ); | ||
//Nepaleidžiamas | ||
// -1 && 0 = 0, falsy | ||
if (-1 && 0) alert( 'antras' ); | ||
//Įvykdomas | ||
//Operatorius &&turi aukštesnį prioritetą negu || | ||
//tad -1 && 1įvykdomas pirmiau, sukurdamas mums grandinę: | ||
// null || -1 && 1 -> null || 1 -> 1 | ||
if (null || -1 && 1) alert( 'trečias' ); | ||
``` | ||
12 changes: 6 additions & 6 deletions1-js/02-first-steps/11-logical-operators/8-if-question/task.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion1-js/02-first-steps/11-logical-operators/9-check-login/ifelse_task.svg
Loading
Sorry, something went wrong.Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions1-js/02-first-steps/11-logical-operators/9-check-login/solution.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
```js run demo | ||
let userName = prompt("Kas čia?", ''); | ||
if (userName == 'Admin') { | ||
let pass = prompt('Slaptažodis?', ''); | ||
if (pass == 'TheMaster') { | ||
alert( 'Sveiki!' ); | ||
} else if (pass == '' || pass == null) { | ||
alert( 'Atšaukta' ); | ||
} else { | ||
alert( 'Neteisingas slaptažodis' ); | ||
} | ||
} else if (userName == '' || userName == null) { | ||
alert( 'Atšaukta' ); | ||
} else { | ||
alert( "Aš jūsų nepažįstu" ); | ||
} | ||
``` | ||
Atkreipkite dėmesį į vertikalius įgilėjimus viduje `if`rinkinio. Techniškai jie nėra būtini, bet jie paverčia kodą lengviau skaitomu. |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.