+ 1

Problem with returning value from asynchronous function using callback

Here in my code, I want the processInput() to return the final result, but I am actually dealing with asynchronous function that returns a promise, so I am feeling harder to do it. Anyone can help me plz. My requirement is the function "processInput()" should return the result. https://code.sololearn.com/WAZ9kYhNzsaH/?ref=app

21st Dec 2020, 10:05 AM
March Zucherbug
March Zucherbug - avatar
3 odpowiedzi
+ 3
March Zucherberg I got the problem The console log runs before it gets the data. If your log the value in the call back function then it works
21st Dec 2020, 10:45 AM
Krish
Krish - avatar
+ 3
And also if you are using promise then no need to use async await.
21st Dec 2020, 10:47 AM
Krish
Krish - avatar
+ 2
21st Dec 2020, 1:51 PM
ODLNT
ODLNT - avatar
OSZAR »