DEV Community

Discussion on: await, then, return?

Collapse
 
nombrekeff profile image
Keff

As far as I can tell, without knowing the sharp API at all, it seems that thumbnailBuffer will be a buffer is the width is greater that 200, otherwise it will be undefined.

Collapse
 
bacloud22 profile image
aben

Yes that what I intended to writing the code. But I meant JavaScript language speaking, does the return inside then return the value (here buffer/undefined) or a promise or go to heat...

Collapse
 
nombrekeff profile image
Keff

It should be the value, as you're using async/await.