رقصنده با کد – Telegram
رقصنده با کد
781 subscribers
1.69K photos
850 videos
207 files
666 links
Here are some interesting things I've come across during my learning process. That's it. Admin ID:
@alithecodeguy
Download Telegram
Frontend Mostly Asked Interview questions and answers !

Q1: What are micro and macro task queues in JavaScript, and how do they relate to the event loop?
Answer: Micro and macro task queues are part of the event loop in JavaScript. Microtasks have higher priority and execute before macrotasks. Microtasks are typically used for high-priority, non-blocking operations like promises, while macrotasks handle less time-sensitive tasks like I/O operations and rendering updates.

Q2: How can you schedule code to run in the microtask queue, and what is the order of execution compared to the macrotask queue?
Answer: Code can be scheduled to run in the microtask queue using functions like Promise.then(), Promise.catch(), and Promise.finally(). Microtasks have higher priority and are executed before macrotasks in the event loop.

Q3: What kinds of operations are typically placed in the macrotask queue, and how do you schedule them?
Answer: Macrotasks are typically used for operations like I/O (e.g., file read), network requests (e.g., API calls), and rendering updates (e.g., modifying the DOM). You can schedule macrotasks using functions like setTimeout, setInterval, and requestAnimationFrame.

Q4: Explain the order of execution when both micro and macro tasks are in the queue.
Answer: When both micro and macro tasks are in the queue, microtasks are executed until the microtask queue is empty. Only then are macrotasks executed. This ensures that high-priority microtasks are processed first. Micro and macro task queues help manage the execution order of asynchronous operations. Microtasks allow high-priority tasks to execute promptly, maintaining UI responsiveness. Macrotasks handle less critical tasks, preventing them from blocking the main thread.

Q5: How do you schedule asynchronous code to run in the microtask queue, and what are common use cases for microtasks?
Answer: Asynchronous code can be scheduled to run in the microtask queue using Promise methods like .then(), .catch(), and .finally(). Common use cases for microtasks include handling promises, DOM mutations, and updating application state before rendering.

Q6: Can you explain the potential drawbacks of excessive use of microtasks in an application?
Answer: Excessive use of microtasks can lead to "starvation" of the macrotask queue, causing macrotasks like rendering and user input handling to be delayed. This can result in a less responsive user interface and potential performance issues.
پست بالا رو توی لینکدین دیدم. به نظرم بخونید ضرر نمی‌کنید
کانفیگ بدردبخوریه روی vscode 👌
Forwarded from توییتر فارسی
This media is not supported in your browser
VIEW IN TELEGRAM
چطوری اون همه عدد را دید بعد چطوری حساب کتاب کرد 😳😳

•Abed•
This media is not supported in your browser
VIEW IN TELEGRAM
Vite in 100 Seconds
توی ۱۰۰ ثانیه کلمات کلیدی‌ای میگه که به نظرم اگر فرصت کردید برید مطالعشون کنید. هر کدوم دنیاییه برای خودش.
#vite
اصل SRP میگه هر ماژول دقیقا باید فقط و فقط ۱ کار رو انجام بده.
اگر همین اصل رو به ریکت تعمیمش بدید ، معناش این میشه هر کامپوننت فقط و فقط یک کار رو باید انجام بده و اگر برای انجام اون هدف مشخص ، نیازه که چندتا کار متفاوت انجام بده ، هر کدوم از اون کارها رو به یک کامپوننت مستقل اختصاص بدید.
A Collection of Awesome Free APIs
#api
js_questions.pdf
7 MB
نمونه سوالات و جواب های مهم جاوااسکریپت به زبان فارسی
----
این فایل از صفحه لینکدین آقای مصطفی میری گرفته شده.
👌
#js #interview
اولین دوره مقدماتی و عمیق جاوا‌اسکریپت!
مباحث مقدماتی رو ، هم به شکل به‌روز‌تر و هم به شکل عمیق‌تر بررسی میکنیم.
اطلاعات بیشتر در تصویر.
لینک کانال تلگرامی:
https://news.1rj.ru/str/alithecodeguy
اگر قبلا Nextjs کار کردید و الان میخواید به نسخه جدیدش سوییچ کنید (۱۳ و بالاتر) و از ویژگی‌های جدیدش استفاده کنید ، دوره زیر رو به صورت رایگان از دانلودلی می‌تونید دانلود کنید.
دوره خوبیه.
https://downloadly.ir/elearning/video-tutorials/introduction-to-next-js-13-v3/
#nextjs
لجندا متوجهش میشن 💨 😁
ورسل (سازنده نکست‌جی‌اس) جایگزین جیرا رو معرفی کرد!
سرعت توسعه محصولاتش غیر عادی زیاد شده.
دو شب پیش هم دوباره برای نکست ورژن داد.
سوال ریکتی : propagation برای همه eventها اتفاق میفته به جز یک مورد. اون چیه؟
اگر از Tailwind استفاده می‌کنید این ۳ تا ریسورسی که برای کامپوننت‌ها ، آیکون‌ها و پترن‌های رایگان داخل داکیومنتش معرفی کرده رو دریابید. جذابن:
https://headlessui.dev/
https://heroicons.com/
https://heropatterns.com/
همیشه پست خوب دیدیم ، این سری کامنت خوب ببینیم 👌
#js #tip @alithecodeguy
سوال مصاحبه‌ای ریکت:
یک کامپوننت در چه شرایطی ری‌رندر میشه؟
جوابش ساده به نظر میاد ولی قبل از جواب دادن ، بیشتر بهش فکر کنید.
#react #interview #js @alithecodeguy