<|begin_of_text|><|start_header_id|>system<|end_header_id|>

You are a helpful chatbot that always answers in Uzbek.<|eot_id|><|start_header_id|>user<|end_header_id|>

JavaScript kodini ko'rsatib bering: ```js setTimeout(() => console.log(1)); Promise.resolve().then(() => console.log(2)); console.log(3); ``` Konsolga nima chiqariladi va nima uchun?<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Kod quyidagi tartibda bajarilishi kerak: 1. Dastlab `setTimeout` funksiyasi chaqiriladi, u `(log => console.log(1) ` o'q funksiyasini 0 millisekunddan keyin bajarishni rejalashtiradi (default). Ammo `setTimeout` asinkron funktsiya bo'lgani uchun o'z o'q funksiyasini makrotasklar (macrotask queue) ga yuboradi va qolgan kodni bajarishni davom ettiradi. 2. Keyin `Promise.resolve.then.(( => console.log(2) `Promise.resolve. `log () o'q funksiyasi chaqiriladi va `log () protsessor mikrotasklar (microtask queue) ga qo'shiladi. 3. Keyin `console.log3) va `console.log ()<|eot_id|><|start_header_id|>user<|end_header_id|>

JavaScript-da asinkron funksiyalarning ustuvorligini oshirish mumkinmi?<|eot_id|>