diff --git a/js/asyncSupport b/js/asyncSupport new file mode 100644 index 0000000..a5490a6 --- /dev/null +++ b/js/asyncSupport @@ -0,0 +1,10 @@ +//判断浏览器是否支持Async和Await +function isAsyncAwaitSupport() { + let func; + try { + eval("func = async function(){};"); + } catch (e) { + return false; + } + return Object.getPrototypeOf(func).constructor != null; +} \ No newline at end of file