DEV Community

Discussion on: ES6 Nodejs Project Kickstart

Collapse
 
lagsurfer profile image
Barney

router.get('/getData', async (req, res) => { why is this function async?

Collapse
 
c4r4x35 profile image
Srinivas Kandukuri

In the next line we have written

 const response = Helperservice.reverse();

we can write this method as promise or callback with await

Collapse
 
hilleer profile image
Daniel Hillmann

He probably intented to await on the next line :)