Bhupendrabhuppi.hashnode.dev·Oct 23, 2024How asynchronous code is executed in JavaScriptIn JavaScript, asynchronous code is handled using the event loop, which allows non-blocking execution. JavaScript is single-threaded, meaning it can only perform one task at a time. However, it can handle asynchronous tasks efficiently without blocki...DiscussJavaScript
Aparna Udayakumaraparna-u.hashnode.dev·Aug 15, 2024How JavaScript Actually Works: The Event LoopIn JavaScript, the event loop is the mechanism that processes and responds to events. It's responsible for executing code, collecting and processing events, and executing queued sub-tasks. To grasp this concept fully, we need to delve into several in...Discuss·1 like·33 readsJavaScript
Urvashi Nigamtechieurvashi.hashnode.dev·Jul 18, 2024Understanding Callback Execution Order and Avoiding Infinite Loops in Ruby on RailsWhen working with callbacks in Ruby on Rails, understanding their execution order and how to avoid pitfalls like infinite loops is crucial. Let's delve into an example to illustrate these concepts! 🚀The Problem: Callbacks and Infinite Loops 🔄 Consi...Discuss·12 likescallback
Gaurav Goswamigauravgoswami.hashnode.dev·Mar 31, 2024How JavaScript works??? 🤔💭When I started my journey with JavaScript I used to think about how things work under the hood, why the setTimeout code runs after the synchronous code, how is it even possible to call a function even before declaring it, and why do we get errors if ...Discuss·1 like·157 readsjsworking
Sahitya Aryanducklogic.hashnode.dev·Dec 21, 2023Demystifying JavaScript's Event Loop: Navigating the Event Loop and Callback Queues (Part 1)Welcome, techies! Now, let me ask you a question, and it is very important to answer this before continuing: Do you know what EventLoop or callBack queue is? Don't know the answer? No worries at all! Because we are going to get it, but the approach t...Discuss·31 readsEvent Loop
Sahitya Aryanducklogic.hashnode.dev·Dec 21, 2023Demystifying JavaScript's Event Loop: Microtask queue (Part 2)Welcome, techies! Today, we are going to explore the microtaskQueue. It is closely intertwined with the callBackQueue, and its existence is often overlooked on the Internet. However, it plays a magical role in the Event Loop. I'm willing to bet that ...DiscussEvent Loop
Ojas Elawadhiojaselawadhi.hashnode.dev·Nov 15, 2023The Magical Dance of JavaScript: How the Event Loop Keeps Things Lively!Hey there, fellow JavaScript explorer! Today, let's embark on an adventure into the enchanting world of the JavaScript event loop. Ever wondered how your code juggles multiple tasks without getting tangled up? Well, it's all thanks to the mesmerizing...DiscussJavaScript
Dipta Sahadipta.hashnode.dev·Jul 11, 2023JavaScript এ Event LoopExecution Context এর Concept থেকে আমরা জানি যে, যখন JS code run করা হয় তখন Global Execution Context তৈরি হয় এবং সেটি JS Engine এর মধ্যে Call Stack এ Push হয়। চলুন এই Concept এর মাধ্যমে Event Loop কি, কেন, কিভাবে কাজ করে সেটি বোঝা যাক। প্রথমেই বলে নেই...Discuss·2 likes·428 readsEvent Loop
laptrinhvien.hashnode.dev·Jun 26, 2023Event loop và callback queue trong JavaScriptJavaScript là ngôn ngữ lập trình đơn luồng (một câu lệnh (dòng code) được thực thi tại một thời điểm) và có mô hình thực thi đồng bộ (mỗi câu lệnh sẽ được thực thi theo thứ tự xuất hiện). Vậy phải thế nào khi ta cần đợi một khoảng thời gian trước khi...Discusscallbackqueue
laptrinhvien.hashnode.dev·Jun 26, 2023Promise & microtask queue trong JavaScriptPromise Promise là một special object được tích hợp trong JavaScript. Promise đóng vai trò là một placeholder cho dữ liệu chúng ta mong muốn nhận lại được từ hoạt động nền của web browser feature. Trong JavaScript, Promise được dùng để xử lý những vấ...Discusspromises