• Register

Share:- Whatsapp Facebook Facebook

------------------------------------- Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.


0 votes
What are Promises in node.js?
in Node.js by

1 Answer

0 votes
Promises are the concurrency primitive. Promises are the part of most modern programming languages to make programming life easier. Promises can help us to handle async operations in better way.

Example:- Following code 1000ms prints out the result string in standard output.

new Promise((resolve, reject) => {
  setTimeout(() => {
  }, 1000)
by (1.7k points)