0

Is the promise in javascript and node js are same?

21st Jul 2022, 1:48 PM
Ajmal K saleem
Ajmal K saleem - avatar
6 Answers
0
Yes, more precisely it is in JS
21st Jul 2022, 2:40 PM
Muhammadamin Alijonov
Muhammadamin Alijonov - avatar
0
Muhammadamin Alijonov so in JavaScript promises are used for making it asynchronous. But in nodejs, it is already asynchronous. So what is the purpose of promise in node js
21st Jul 2022, 2:56 PM
Ajmal K saleem
Ajmal K saleem - avatar
0
For instance, we want to request 2 or more another API s from Backend, in this case we need to use Promises
21st Jul 2022, 3:32 PM
Muhammadamin Alijonov
Muhammadamin Alijonov - avatar
21st Jul 2022, 3:33 PM
Muhammadamin Alijonov
Muhammadamin Alijonov - avatar
0
See for more information
21st Jul 2022, 3:34 PM
Muhammadamin Alijonov
Muhammadamin Alijonov - avatar
0
Ajmal K saleem Who said node is async by default? Node is a js runtime which uses the same V8 engine that we use in chrome. There are two separate APIs for the Sync & Async calls in the node built in libs for almost everything. Example: - readFile - readFileSync but we generally use the readFile which is asynchronous because fs operation much be non blocking.
21st Jul 2022, 3:34 PM
zexu knub
zexu knub - avatar