摘要:
const promise1 = Promise.resolve(3);const promise2 = 42;const promise3 = new Promise((resolve, reject) => { setTimeout(resolve, 100, 'foo');}); Promis 阅读全文
摘要:
<script type="text/javascript"> let p1 = new Promise(function(resolve,reject){ setTimeout(function(){ resolve("450毫秒后执行") },450) }); let p2 = new Prom 阅读全文
摘要:
//这是promise 为成功状态window.onload=function () { let p1=new Promise(function (resolve,reject) { let arr={name:'make'}; resolve(arr); }); p1.then((data)=>{ 阅读全文
摘要:
window.onload=function () { let arr=[1,2,3,4,5,6,7,4]; function *fn(arr) { for(let i=0;i<arr.length;i++){ yield arr[i]; } } let result=fn(arr); // con 阅读全文