Javascript promise resolve async
Promise.resolve([1, 2, 3]);
Is Promise.resolve() asynchronous?
No that's just a regular function call. It will return a result immediately.
Or is .then asynchronous or even both functions
No. Both aren't asynchronous in the sense that
promise1.then((value) => console.log(value));
will immediately return a new Promise for chaining.
However a Promise definitely resolves asynchronously, which means that the inner function (value => console.log(value)) is called definitely after your whole synchronous code executed.
Is there some other mechanism playing under the hood?
Yes there is a "magic" event loop in the background which manages all the async events.