There is a script:
function func(){ console.log('start'); ... } func(); console.log('end');
What code to write instead of ...
so that between the first log and the exit from the function (and not between the first and second logs) 1 second is passed?
If you do this, then the time
log will be displayed a second after the end
log:
function func(){ console.log('start'); setTimeout(function(){console.log('time');}, 1000); } func(); console.log('end');