写法1 let queryData = function queryData() { return new Promise((resolve, reject) => { }); }; let qu = queryData(); qu.then(xxx);
写法2
let queryData = new Promise((resolve, reject) => { }); }; let qu = queryData; qu.then(xxx);
写法1 和写法2 有什么区别? 为什么要new promise 要放到return里?用意何在?
橋本奈奈未
相关分类