05 2019 档案
摘要://1 async 返回一个promise对象所以可以通过.then来调用 async function test1() { return "测试数据" }test1().then((e)=>{ console.log(e) // 测试数据});//2 async 里面如果遇到 return 会直接
阅读全文
摘要:举个例子function Test() { this.name = "吕布"; this.age = "35"; this.skill_1 = function () { console.log(2) }; this.skill_2 = function () { console.log(3) }}
阅读全文
摘要:最近听到一个词叫"并发",其实在工作中很多这种处理的场景只是没有并发这种概念,今天总结一下 。 假设场景: 一个普通查询页面,需要刚进页面就同时调用4个接口,只有全部接口都调用完成才能让用户操作这时候怎么办? 首先 es6 可以使用 Promise.all() 可以用一个变量去保存或者记录每个接口成
阅读全文