I'm getting more and more confortable with the asyncawait library.
If I'm correct, this:
var doSth = async function() {
var asyncResult = await promiseReturningFunction();
subFunction(asyncResult);
};
is equivalent to:
var doSth = function() {
promiseReturningFunction().then(function(asyncResult) {
subFunction(asyncResult);
});
};
But what if the callback has two arguments .then(function(asyncResult1, asyncResult2) {})
?
In some other languages, I'd write:
var asyncResult1, asyncResult2 = await promiseReturningFunction();
but I can't do this in JS, can I? Does await returns an array? The first argument?