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
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -200,18 +200,18 @@ Bütün digər tiplər "primitiv (primitive)" tip adlanır, çünki, onların d
200
200
201
201
`symbol` tipi obyektlər üçün unikal identifikatorlar yaratmaqda istifadə olunur. Onu burada tamlıq üçün qeyd edirik, lakin obyektləri öyrəndikdən sonra bu mövzuya qayıdacağıq.
202
202
203
-
## The typeof operator [#type-typeof]
203
+
### `typeof` operatoru [#type-typeof]
204
204
205
-
The `typeof`operator returns the type of the argument. It's useful when we want to process values of different types differently or just want to do a quick check.
205
+
`typeof`operatoru arqumentin tipini qaytarır. Fərqli tipləri müxtəlif üsullarla işləmək lazım olduqda və ya sadəcə sürətli bir yoxlama aparmaq istədikdə çox faydalıdır.
206
206
207
-
It supports two forms of syntax:
207
+
Bu operator iki sintaksisi dəstəkləyir:
208
208
209
-
1. As an operator: `typeof x`.
210
-
2. As a function: `typeof(x)`.
209
+
1. Operator kimi: `typeof x`.
210
+
2. Funksiya kimi: `typeof(x)`.
211
211
212
-
In other words, it works with parentheses or without them. The result is the same.
212
+
Başqa sözlə, mötərizələrlə və ya mötərizəsiz istifadə edilə bilər. Hər iki halda nəticə eyni olur.
213
213
214
-
The call to `typeof x`returns a string with the type name:
The last three lines may need additional explanation:
242
+
Son üç sətir əlavə izah tələb edə bilər:
243
243
244
-
1. `Math`is a built-in object that provides mathematical operations. We will learn it in the chapter <info:number>. Here, it serves just as an example of an object.
245
-
2. The result of `typeofnull`is`"object"`. That's wrong. It is an officially recognized error in `typeof`, kept for compatibility. Of course, `null`is not an object. It is a special value with a separate type of its own. So, again, this is an error in the language.
246
-
3. The result of `typeof alert`is`"function"`, because`alert`is a function. We'll study functions in the next chapters where we'll also see that there's no special "function" type in JavaScript. Functions belong to the object type. But`typeof`treats them differently, returning `"function"`. That's not quite correct, but very convenient in practice.
244
+
1. `Math`riyazi əməliyyatlar təqdim edən daxili obyektlərdən biridir. Biz onu <info:number> fəsilində daha ətraflı öyrənəcəyik. Burada isə, sadəcə obyektin bir nümunəsi kimi istifadə olunub.
245
+
2. `typeofnull`nəticəsi`"object"` olaraq qaytarılır. Bu, səhvdir. Bu, `typeof` operatorunun rəsmi olaraq tanınmış bir xətasıdır və uyğunluq səbəbilə saxlanılıb. Əslində, `null`bir obyekt deyil. O, ayrıca bir tipə malik xüsusi bir dəyərdir. Beləliklə, bu, JavaScript dilində mövcud olan bir qüsurdur.
246
+
3. `typeof alert`nəticəsi`"function"` olur, çünki,`alert`bir funksiyadır. Biz funksiyaları növbəti fəsillərdə öyrənəcəyik. Orada görəcəyik ki, əslində JavaScript-də xüsusi bir "function" tipi yoxdur. Funksiyalar `object` tipinə daxildir. Lakin,`typeof`funksiyalara fərqli davranaraq `"function"` kimi qaytarır. Bu tam doğru deyil, lakin praktikada çox rahatdır.
0 commit comments