I have a function:

var myFunc = async function() { await fetch... ... }; 

What happens to this function if you override it like this:

 var alias = myFunc; myFunc = function() { alias.call(this); ... }; 

Will the asynchronous part (await) continue in the first variant of the function after calling alias.call (this)?

  • it will be executed, but you will not receive the result, since it is asynchronous and you exit the function (stack) before the result of the asynchronous function (promise) returns. - Sultanov Shamil

0