Queues in Node js

Have you been using node js for a while now? Are you aware of how things work internally in node js? the queues in node js? Doesn’t matter if your answer is yes or no, I will let you in on one little secret which will clear all your doubts regarding ho…


This content originally appeared on DEV Community and was authored by Nitin Sahu

Have you been using node js for a while now? Are you aware of how things work internally in node js? the queues in node js? Doesn’t matter if your answer is yes or no, I will let you in on one little secret which will clear all your doubts regarding how node js works asynchronously under the hood.

Let’s test your knowledge on node js. If you understand the queues in node js, you would be able to solve the below question.

console.log("1");
setTimeout(() => console.log("2"),0);
var promise = new Promise(function(resolve, reject) {
resolve();
});
promise.then(function(resolve) {
console.log('3');
})
.then(function(resolve) {
console.log('4');
});
console.log("5");

Like what you read?

Read the full article on readosapien.com

Article link


This content originally appeared on DEV Community and was authored by Nitin Sahu


Print Share Comment Cite Upload Translate Updates
APA

Nitin Sahu | Sciencx (2022-02-01T16:12:05+00:00) Queues in Node js. Retrieved from https://www.scien.cx/2022/02/01/queues-in-node-js/

MLA
" » Queues in Node js." Nitin Sahu | Sciencx - Tuesday February 1, 2022, https://www.scien.cx/2022/02/01/queues-in-node-js/
HARVARD
Nitin Sahu | Sciencx Tuesday February 1, 2022 » Queues in Node js., viewed ,<https://www.scien.cx/2022/02/01/queues-in-node-js/>
VANCOUVER
Nitin Sahu | Sciencx - » Queues in Node js. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/01/queues-in-node-js/
CHICAGO
" » Queues in Node js." Nitin Sahu | Sciencx - Accessed . https://www.scien.cx/2022/02/01/queues-in-node-js/
IEEE
" » Queues in Node js." Nitin Sahu | Sciencx [Online]. Available: https://www.scien.cx/2022/02/01/queues-in-node-js/. [Accessed: ]
rf:citation
» Queues in Node js | Nitin Sahu | Sciencx | https://www.scien.cx/2022/02/01/queues-in-node-js/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.