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.stack.imgur.com/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

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

1 Answers1

0

To achieve expectation you should use async series method

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

Community
  • 1
  • 1
Rocket55
  • 157
  • 1
  • 9