DEV Community

Discussion on: Capture error and data in async-await without try-catch

Collapse
 
prateek1712 profile image
Prateek Jesingh • Edited

Shouldn't the wrapper have a return before promise? Else it would return undefined

Collapse
 
sadarshannaiynar profile image
Adarsh

In ES5 you can write a function like this const foo = args => 'bar'; and it will return bar when invoked. This is known as implicit return when it spans multiple lines you enclose it with in ( /* code */ ).