Given a variable, which is defined as follows:
const f = async function() {/* ... */};
How can I check if the variable f
is of type async function
?
I already found this solution:
f.constructor.name === "AsyncFunction";
But the "f.constructor.name" is not compatible with IE11. Any other ideas ?
I know async functions does not work in IE11, ... but they work through babel compilation process. The idea is to find a way to detect async functions in an environment like node.js which would be compatible with IE11/babel for instance