You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/02-structure/article.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,40 +13,40 @@ Kodumuzda istədiyimiz qədər ifadə ola bilər. İfadələr nöqtəli vergüll
13
13
Məsələn, burada "Salam, dünya" mesajını iki xəbərdarlıq şəklində ayırmışıq:
14
14
15
15
```js run no-beautify
16
-
alert('Hello'); alert('World');
16
+
alert('Salam'); alert('Dünya');
17
17
```
18
18
19
-
Usually, statements are written on separate lines to make the code more readable:
19
+
Adətən, ifadələr kodun oxunaqlılığını artırmaq üçün ayrı-ayrı sətirlərdə yazılır:
20
20
21
21
```js run no-beautify
22
-
alert('Hello');
23
-
alert('World');
22
+
alert('Salam');
23
+
alert('Dünya');
24
24
```
25
25
26
-
## Semicolons[#semicolon]
26
+
## Nöqtəli Vergüllər[#semicolon]
27
27
28
-
A semicolon may be omitted in most cases when a line break exists.
28
+
Sətir kəsilməsi mövcud olduqda nöqtəli vergül buraxıla bilər.
29
29
30
-
This would also work:
30
+
Bu da işləyəcək:
31
31
32
32
```js run no-beautify
33
-
alert('Hello')
34
-
alert('World')
33
+
alert('Salam')
34
+
alert('Dünya')
35
35
```
36
36
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
+
Burada JavaScript interpretatoru sətir sonunu "örtülü" nöqtəli vergül kimi qəbul edir. Bu proses [avtomatik nöqtəli vergül daxil edilməsi (automatic semicolon insertion)](https://tc39.github.io/ecma262/#sec-automatic-semicolon-insertion) adlanır.
38
38
39
-
**In most cases, a newline implies a semicolon. But "in most cases" does not mean "always"!**
39
+
**Əksər hallarda yeni sətir bir nöqtəli vergülü nəzərdə tutur. Amma "əksər hallarda" "hər zaman" demək deyil!**
40
40
41
-
There are cases when a newline does not mean a semicolon. For example:
41
+
Müəyyən hallar var ki, yeni sətir nöqtəli vergül anlamına gəlmir. Məsələn:
42
42
43
43
```js run no-beautify
44
44
alert(3+
45
45
1
46
46
+2);
47
47
```
48
48
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
+
Bu kodun nəticəsi`6`olacaq, çünki, JavaScript interpretatoru burada nöqtəli vergül daxil etmir. JavaScript üçün intuitiv olaraq aydındır ki, əgər sətir `+` (üstəgəl) simvolu ilə bitirsə, bu "natamam ifadə"dir və nöqtəli vergül tələb olunmur. Bu halda kod gözlənildiyi kimi işləyir.
50
50
51
51
**But there are situations where JavaScript "fails" to assume a semicolon where it is really needed.**
0 commit comments