I have the following:
var module = {}
module.setDate = function() {
var d = new Date();
return d;
}
Say I now have:
function logDate(){
var date = module.setDate();
console.log(date)
console.log('finished')
}
Is the setting of var date
to the return value of module.setDate()
synchronous or asynchronous? Could the console ever look like:
undefined
'finished'