BROGRAMMIST Telegram 246
console.dir() chuqurligi

Bugun console.dir() da "depth" parametri borligini o'rgandim. Odatda Node.js da obyektlarni terminalga chiqarishda console.log() yoki console.dir() dan foydalanaman. Ikkovini farqini shu paytgacha sezmaganman. Faqat brauzer konsolida farqini bilar edim. (Siz bilasizmi?)

Xullas, odatda obyektlarni terminalga chiqarganda, obyektlar qisqartirib ko'rsatiladi, ya'ni "chuqurroq" joylashgan ma'lumotlar "[Object]" deb qisqartirib ketiladi.

Obyektlarni to'liq ko'rish uchun esa bunday qilish mumkin ekan:


console.dir(obj, { depth: 100 });

"depth" - istalgan son, xatto Infinity bo'lishi mumkin.

Har xil JS bajarilish muhitlarida (runtime environment) sinab ko'rdim. Qizig'i, "Bun"da obyektlar doimo to'liq ko'rsatilar ekan.



tgoop.com/brogrammist/246
Create:
Last Update:

console.dir() chuqurligi

Bugun console.dir() da "depth" parametri borligini o'rgandim. Odatda Node.js da obyektlarni terminalga chiqarishda console.log() yoki console.dir() dan foydalanaman. Ikkovini farqini shu paytgacha sezmaganman. Faqat brauzer konsolida farqini bilar edim. (Siz bilasizmi?)

Xullas, odatda obyektlarni terminalga chiqarganda, obyektlar qisqartirib ko'rsatiladi, ya'ni "chuqurroq" joylashgan ma'lumotlar "[Object]" deb qisqartirib ketiladi.

Obyektlarni to'liq ko'rish uchun esa bunday qilish mumkin ekan:


console.dir(obj, { depth: 100 });

"depth" - istalgan son, xatto Infinity bo'lishi mumkin.

Har xil JS bajarilish muhitlarida (runtime environment) sinab ko'rdim. Qizig'i, "Bun"da obyektlar doimo to'liq ko'rsatilar ekan.

BY Brogrammist






Share with your friend now:
tgoop.com/brogrammist/246

View MORE
Open in Telegram


Telegram News

Date: |

Just at this time, Bitcoin and the broader crypto market have dropped to new 2022 lows. The Bitcoin price has tanked 10 percent dropping to $20,000. On the other hand, the altcoin space is witnessing even more brutal correction. Bitcoin has dropped nearly 60 percent year-to-date and more than 70 percent since its all-time high in November 2021. But a Telegram statement also said: "Any requests related to political censorship or limiting human rights such as the rights to free speech or assembly are not and will not be considered." The channel also called on people to turn out for illegal assemblies and listed the things that participants should bring along with them, showing prior planning was in the works for riots. The messages also incited people to hurl toxic gas bombs at police and MTR stations, he added. Unlimited number of subscribers per channel 2How to set up a Telegram channel? (A step-by-step tutorial)
from us


Telegram Brogrammist
FROM American