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/05-types/article.md
+18-17Lines changed: 18 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,55 +12,56 @@ Bu cür hallara icazə verən proqramlaşdırma dillərinə "dinamik tipli dill
12
12
13
13
JavaScript-də 8 əsas verilən tipi mövcuddur. Bu fəsildə onları ümumi olaraq nəzərdən keçirəcəyik, növbəti fəsillərdə isə hər biri haqqında daha ətraflı danışacağıq.
14
14
15
-
## Number
15
+
## Rəqəm
16
16
17
17
```js
18
18
let n =123;
19
19
n =12.345;
20
20
```
21
21
22
-
The *number* type represents both integer and floating point numbers.
22
+
*Number* tipi həm tam ədədləri, həm də onluq kəsirli ədədləri təmsil edir.
23
23
24
-
There are many operations for numbers, e.g. multiplication `*`, division `/`, addition `+`, subtraction `-`, and so on.
24
+
Rəqəmlər üçün vurma (`*`), bölmə (`/`), toplama (`+`), çıxma (`-`) və s. kimi bir çox əməliyyat mövcuddur.
25
25
26
-
Besides regular numbers, there are so-called "special numeric values" which also belong to this data type: `Infinity`, `-Infinity`and`NaN`.
26
+
Adi ədədlərlə yanaşı, bu verilən tipinə aid olan "xüsusi ədədi dəyərlər" də var: `Infinity`, `-Infinity`və`NaN`.
27
27
28
-
-`Infinity`represents the mathematical [Infinity](https://en.wikipedia.org/wiki/Infinity)∞. It is a special value that's greater than any number.
28
+
-`Infinity`riyaziyyatdakı [sonsuzluğu](https://en.wikipedia.org/wiki/Infinity)(`∞`) ifadə edir. Bu, xüsusi bir dəyərdir və hər hansı bir ədəddən böyükdür.
29
29
30
-
We can get it as a result of division by zero:
30
+
Biz onu bir ədədi sıfıra bölməklə əldə edə bilərik:
31
31
32
32
```js run
33
33
alert( 1/0 ); // Infinity
34
34
```
35
35
36
-
Or just reference it directly:
36
+
Və ya birbaşa ona müraciət edə bilərik:
37
37
38
38
```js run
39
39
alert( Infinity ); // Infinity
40
40
```
41
-
-`NaN` represents a computational error. It is a result of an incorrect or an undefined mathematical operation, for instance:
41
+
42
+
-`NaN` hesablama xətasını ifadə edir. Bu, səhv və ya qeyri-müəyyən bir riyazi əməliyyatın nəticəsidir. Məsələn:
42
43
43
44
```js run
44
-
alert( "not a number" / 2 ); // NaN, such division is erroneous
45
+
alert( "rəqəm deyil" / 2 ); // NaN, bu cür əməliyyat yanlışdır
45
46
```
46
47
47
-
`NaN`is sticky. Any further operation on `NaN` returns `NaN`:
48
+
`NaN`"yapışqan" kimidir. Üzərində aparılan hər hansı bir əməliyyat yenə `NaN` qaytarır:
48
49
49
50
```js run
50
-
alert( "not a number" / 2 + 5 ); // NaN
51
+
alert( "rəqəm deyil" / 2 + 5 ); // NaN
51
52
```
52
53
53
-
So, if there's a `NaN` somewhere in a mathematical expression, it propagates to the whole result.
54
+
Yəni, əgər bir riyazi ifadədə `NaN`varsa, bu, nəticənin hamısına təsir edir.
54
55
55
-
```smart header="Mathematical operations are safe"
56
-
Doing maths is "safe" in JavaScript. We can do anything: divide by zero, treat non-numeric strings as numbers, etc.
0 commit comments