Skip to content

Commit 94b4de2

Browse files
committed
Translated error handling and semicolon-related sections to Azerbaijani
1 parent 403307d commit 94b4de2

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,51 +48,51 @@ alert(3 +
4848

4949
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.
5050

51-
**But there are situations where JavaScript "fails" to assume a semicolon where it is really needed.**
51+
**Amma müəyyən hallar da var ki, JavaScript belə hallarda nöqtəli vergülü avtomatik əlavə edə bilmir və nəticədə xəta yaranır.**
5252

53-
Errors which occur in such cases are quite hard to find and fix.
53+
Belə hallarda xətaları tapmaq və düzəltmək olduqca çətin ola bilər.
5454

55-
````smart header="An example of an error"
56-
If you're curious to see a concrete example of such an error, check this code out:
55+
````smart header="Xəta üçün bir nümunə"
56+
Əgər belə bir xətaya konkret nümunə görmək istəyirsinizsə, bu kodu yoxlayın:
5757
5858
```js run
5959
[1, 2].forEach(alert)
6060
```
6161
62-
No need to think about the meaning of the brackets `[]` and `forEach` yet. We'll study them later. For now, just remember the result of the code: it shows `1` then `2`.
62+
İndilik `[]` (kvadrat mötərizələr) və `forEach` haqqında düşünməyə ehtiyac yoxdur. Onları daha sonra öyrənəcəyik. Hazırda sadəcə kodun nəticəsinə diqqət edin: bu kod əvvəlcə `1`, daha sonra `2` göstərəcək.
6363
64-
Now, let's add an `alert` before the code and *not* finish it with a semicolon:
64+
İndi kodun əvvəlinə bir `alert` əlavə edək və onu nöqtəli vergülsüz bitirək:
6565
6666
```js run no-beautify
67-
alert("There will be an error")
67+
alert("Xəta baş verəcək")
6868
6969
[1, 2].forEach(alert)
7070
```
7171
72-
Now if we run the code, only the first `alert` is shown and then we have an error!
72+
İndi bu kodu işə salsaq, yalnız ilk `alert` mesajı görünəcək və daha sonra xəta ilə üzləşəcəyik!
7373
74-
But everything is fine again if we add a semicolon after `alert`:
74+
Amma əgər `alert` ifadəsindən sonra nöqtəli vergül əlavə etsək, hər şey yenidən qaydasında olacaq:
7575
```js run
76-
alert("All fine now");
76+
alert("Hər şey qaydasındadır.");
7777
7878
[1, 2].forEach(alert)
7979
```
8080
81-
Now we have the "All fine now" message followed by `1` and `2`.
81+
İndi "Hər şey qaydasındadır." mesajından sonra `1` `2` görünür.
8282
8383
84-
The error in the no-semicolon variant occurs because JavaScript does not assume a semicolon before square brackets `[...]`.
84+
Nöqtəli vergülün olmadığı variantda xəta JavaScript'in kvadrat mötərizədən əvvəl nöqtəli vergülü avtomatik əlavə edə bilməməsindən qaynaqlanır.
8585
86-
So, because the semicolon is not auto-inserted, the code in the first example is treated as a single statement. Here's how the engine sees it:
86+
Beləliklə, nöqtəli vergül avtomatik olaraq əlavə edilmədiyindən, ilk nümunədəki kod tək ifadə kimi qəbul olunur. JavaScript mühərriki kodu belə görür:
8787
8888
```js run no-beautify
89-
alert("There will be an error")[1, 2].forEach(alert)
89+
alert("Xəta baş verəcək")[1, 2].forEach(alert)
9090
```
9191
92-
But it should be two separate statements, not one. Such a merging in this case is just wrong, hence the error. This can happen in other situations.
92+
Amma kod iki ayrı ifadə olmalı idi, tək deyil. Bu halda birləşmə səhv baş verir və nəticədə xəta yaranır. Bu problem digər hallarda da yarana bilər.
9393
````
9494

95-
We recommend putting semicolons between statements even if they are separated by newlines. This rule is widely adopted by the community. Let's note once again -- *it is possible* to leave out semicolons most of the time. But it's safer -- especially for a beginner -- to use them.
95+
Əgər ifadələr sətirlərlə ayrılıbsa, onların arasına nöqtəli vergül qoymağı tövsiyə edirik. Bu qayda JavaScript cəmiyyəti tərəfindən geniş şəkildə qəbul olunub. Yenidən bir də qeyd edək ki, nöqtəli vergülləri çox vaxt buraxmaq -- *mümkündür*. Lakin, xüsusilə yeni başlayanlar üçün, nöqtəli vergüllərdən istifadə etmək daha təhlükəsizdir.
9696

9797
## Comments [#code-comments]
9898

0 commit comments

Comments
 (0)