JS Reflect
Reflect — quyi darajadagi metaprogrammalash uchun metodlarga ega JavaScript obyekti.
Metaprogrammalash siz uchun yangimi?
Metaprogrammalash bo‘yicha darsligimizni ko‘ring
Reflect siz uchun yangimi?
To‘liq Reflect ma’lumotnomasi
2025-yil dekabr oyida qayta ko‘rib chiqilgan
| Metod | Tavsif |
|---|---|
| Reflect.apply() | Funksiyani chaqirish |
| Reflect.construct() | Obyekt yaratish (new kabi) |
| Reflect.defineProperty() | Xususiyatni aniqlash (define) |
| Reflect.deleteProperty() | Xususiyatni o‘chirish |
| Reflect.get() | Xususiyatni olish |
| Reflect.getOwnPropertyDescriptor() | Xususiyat deskriptorini olish |
| Reflect.getPrototypeOf() | Obyekt prototipini olish |
| Reflect.has() | Xususiyat mavjudligini tekshirish |
| Reflect.isExtensible() | Obyekt kengaya olishini tekshirish |
| Reflect.ownKeys() | Barcha kalitlarni olish (symbol’lar bilan birga) |
| Reflect.preventExtensions() | Obyekt kengayishini to‘xtatish |
| Reflect.set() | Xususiyatni o‘rnatish |
| Reflect.setPrototypeOf() | Obyekt prototipini o‘rnatish |
JavaScript ichki metodlari
Barcha JavaScript obyektlari 13 ta ichki metodga ega.
Har bir metodning o‘ziga mos Proxy trap’i bor:
| Ichki amal | Proxy trap’i |
|---|---|
| [[Construct]] | construct() |
| [[Call]] | apply() |
| [[Get]] | get() |
| [[Set]] | set() |
| [[HasProperty]] | has() |
| [[Delete]] | deleteProperty() |
| [[DefineProperty]] | defineProperty() |
| [[GetOwnProperty]] | getOwnProperty() |
| [[OwnPropertyKeys]] | ownPropertyKeys() |
| [[IsExstensible]] | isExtensible() |
| [[PreventExstensions]] | preventExtensions() |
| [[GetPrototypeOf]] | getPrototypeOf() |
| [[SetPrototypeOf]] | setPrototypeOf() |
Eslatma
Har bir Proxy trap’iga mos Reflect metodi bor — u trap bilan bir xil nom va signaturaga ega.
| Ichki amal | Reflect metodi |
|---|---|
| [[Construct]] | Reflect.construct() |
| [[Call]] | Reflect.apply() |
| [[Get]] | Reflect.get() |
| [[Set]] | Reflect.set() |
| [[HasProperty]] | Reflect.has() |
| [[Delete]] | Reflect.deleteProperty() |
| [[DefineProperty]] | Reflect.defineProperty() |
| [[GetOwnProperty]] | Reflect.getOwnProperty() |
| [[OwnPropertyKeys]] | Reflect.ownPropertyKeys() |
| [[IsExstensible]] | Reflect.isExtensible() |
| [[PreventExstensions]] | Reflect.preventExtensions() |
| [[GetPrototypeOf]] | Reflect.getPrototypeOf() |
| [[SetPrototypeOf]] | Reflect.setPrototypeOf() |
Shuningdek qarang...
W3Schools Pathfinder
Yutuqlaringizni kuzating – bu bepul!
