JS boshqa operatorlar
JavaScript operatorlari
Quyida ba’zi boshqa JavaScript operatorlari tavsiflangan.
| Operator | Nomi / Havola | Misol |
|---|---|---|
| : | Ikki nuqta | age : 45 |
| . | Nuqta orqali murojaat | person.age |
| [ ] | Kvadrat qavs orqali murojaat | person["age"] |
| [ ] | Massiv literali | cars = ["Saab", "Volvo", "BMW"] |
| { } | Blok | car = {} |
| { } | Obyekt literali | car = {type:"Fiat", model:"500"} |
| ?. | Ixtiyoriy zanjirlash | x ?. y |
| ... | Spread | ...myArray |
| ( ) | Guruhlash | ( x + y ) |
| ( ) ? x : y | Ternar shart operatori | (z < 18) ? x : y |
| ( ) | Chaqirish | myFunction() |
| => | Arrow funksiyasi | (a, b) => a + b |
| new | Konstruktor | new Date() |
| delete | O‘chirish | delete person.age |
| in | in munosabat operatori | "age" in person |
| instanceof | Nusxa tekshiruvi | x instanceof Array |
| typeof | Tipni aniqlash | typeof "John" |
| void | Void | void(0) |
| yield | Yield | yield x |
| yield* | Yield | yield* x |
W3Schools Pathfinder
Yutuqlaringizni kuzating – bu bepul!
