Node.js의 Event Loop Concept 이해하기 2편! 1. Single threaded, and blocking funciton console.log("first task"); console.time(); for (let i = 0; i < 1000000; i++) { const h3 = document.querySelector("h3"); h3.textContent = "Hey, everyone is waiting on me"; } console.timeEnd(); console.log("next task"); : 앞서, 우리는 Event Loop을 살펴보며, Node.js의 특성에 대해 파악했습니다. Node.js의 경우 코드를 line by line으로 읽어내며, 앞선 line의 fun..
전체 글
1. What is JS? Single-threaded, non-blocking , asynchronous, and concurrent language. A) Call stack : Javascript is single-threaded programming language, which means that it has a single call stack! 그렇다면, single-threaded는 무슨 의미일까? 단순히 한번에 하나 의 일만 처리할 수 있다라고 볼 수 있습니다. Call stack에 대한 시각화를 위해 간단한 예제를 작성해봤습니다. function multiply (a, b) { return a*b; } function square (x) { return multiply(x, x); } fu..