Quick examples of sync vs async.
Run node index.js
and look at the output in the console.
Things to think about:
- What order will you see the
console.log
messages in? - Why does
productListReturn
returnundefined
, butproductListCallback
is fine?