-
How Event Loop Works
What is event loopThe Event Loop is an important concept in JavaScript runtime environments, particularly in browsers and Node.js. It manages the execution order of asynchronous operations, callback functions, and events. We could say event loop i...…
-
English
[TOC]English at workEnglish at work is aim to help you to improve the efficiency and ability in the communication at work. Save you much time to understand what is really need at work. Sometimes a good communication is really necessary and import...…
-
An utility function that wraps async functions to handle errors
Handle errors with try…catchIn Node.js, you can use try...catch blocks to handle exceptions (errors) that might occur during the execution of your code. When using an async function, you’ll notice that await only captures the value of a successful...…
-
Parallel and series in JavaScript
参考文档promise的并行 array.map( function(currentElement, index, arr){} ) : map() creates a new array from calling a function for every array element. 当只有第一个参数currentElement的时候,可以写成箭头函数的形式 map(t => {return }), 此处涉及到箭头函数简写 t => {return } 。 函数通过为...…
-
How to debug NodeJS
Default debugging processThe default debugging process of NodeJS (read Node.js) is quite clumsy. You are likely already aware of the need to add --inspect to the node script with node inspector. It is also dependent on Chrome. Then you have to loo...…