0

Firstly, I am very new to node.js and I just started learning about callback function. So, I came to know that callback function basically works to handle multiple requests.

Then I thought of writing a function to see how it normally works without using callback function and I am getting an error here.

[Screenshot of the output][1]

https://i.sstatic.net/30AvR.png

Here, I thought it would work like : Every 5 seconds it would display Order placed : 1 Delivered food with order number: 1 . ... .... .... Delivered food with order number: 6

1
  • Can you edit your question to include your code and output directly in the question? Images can't be searched, copied as text, etc. Commented Dec 11, 2016 at 17:25

1 Answer 1

0

To achieve expectation you should use async series method

Please refer below stackoverflow Nodejs async series - pass arguments to next callback

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.