Skip to content

Commit 7530b4a

Browse files
authored
Update article.md
1 parent a1d7fa4 commit 7530b4a

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

1-js/02-first-steps/02-structure/article.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
# Code structure
1+
# Kodo struktūra
22

3-
The first thing we'll study is the building blocks of code.
3+
Pirmas dalykas, kurį studijuosime yra kodo sudėties blokai.
44

5-
## Statements
5+
## Pareiškimai
66

7-
Statements are syntax constructs and commands that perform actions.
7+
Pareiškimai (ang. Statement) yra sintaksės konstruktai ir komandos, kurios atlieka veiksmus.
88

9-
We've already seen a statement, `alert('Hello, world!')`, which shows the message "Hello, world!".
9+
Mes jau matėme šį pareiškimą, `alert('Labas, pasauli!')`, which shows the message "Labas, pasauli!".
1010

11-
We can have as many statements in our code as we want. Statements can be separated with a semicolon.
11+
Mūsų kode gali būti tiek pareiškimų kiek mes norime. Pareiškimai gali būti atskirti kabliataškiu.
1212

13-
For example, here we split "Hello World" into two alerts:
13+
Pavyzdžiui, čia mes atskirsime "Labas Pasauli" į du perspėjimus:
1414

1515
```js run no-beautify
16-
alert('Hello'); alert('World');
16+
alert('Labas'); alert('Pasauli');
1717
```
1818

19-
Usually, statements are written on separate lines to make the code more readable:
19+
Dažniausiai, pareiškimai yra rašomi atskirose eilutėse tam kad kodas būtų lengviau įskaitomas:
2020

2121
```js run no-beautify
22-
alert('Hello');
23-
alert('World');
22+
alert('Labas');
23+
alert('Pasauli');
2424
```
2525

26-
## Semicolons [#semicolon]
26+
## Kabliataškiai [#semicolon]
2727

28-
A semicolon may be omitted in most cases when a line break exists.
28+
Kabliataškis dažnais atvejais gali būti, pavyzdžiui kai egzistuoja pertrauka eilutėse.
2929

30-
This would also work:
30+
Vadinas, tai irgi suveiktų:
3131

3232
```js run no-beautify
3333
alert('Hello')
3434
alert('World')
3535
```
3636

37-
Here, JavaScript interprets the line break as an "implicit" semicolon. This is called an [automatic semicolon insertion](https://tc39.github.io/ecma262/#sec-automatic-semicolon-insertion).
37+
Čia JavaScript interpretuoja pertrauką eilutėse kaip "numanomą" kabliataški. Tai vadinama [automatišku kabliataškio pridėjimu](https://tc39.github.io/ecma262/#sec-automatic-semicolon-insertion).
3838

39-
**In most cases, a newline implies a semicolon. But "in most cases" does not mean "always"!**
39+
**Dažnais atvejais nauja eilutė numanoma kaip kabliataškio pakaitalas. Bet "dažnais atvejais" nereiškia "visada"!**
4040

41-
There are cases when a newline does not mean a semicolon. For example:
41+
Yra tokių atvejų kai nauja eilutė nereiškia kabliataškio. Pavyzdiui:
4242

4343
```js run no-beautify
4444
alert(3 +
4545
1
4646
+ 2);
4747
```
4848

49-
The code outputs `6` because JavaScript does not insert semicolons here. It is intuitively obvious that if the line ends with a plus `"+"`, then it is an "incomplete expression", so the semicolon is not required. And in this case that works as intended.
49+
Kodas mums atiduoda `6`, nes JavaScript šiuo atveju neįterpia kabliataškio tarp eilučių. It is intuitively obvious that if the line ends with a plus `"+"`, then it is an "incomplete expression", so the semicolon is not required. And in this case that works as intended.
5050

5151
**But there are situations where JavaScript "fails" to assume a semicolon where it is really needed.**
5252

0 commit comments

Comments
 (0)