摘要:
阅读全文
摘要:
https://blog.csdn.net/supperi/article/details/106673051 阅读全文
摘要:
let load =(cb) =>{ let timer let check = ()=>{ if(performance.timing.loadEventEnd){ clearTimeout(timer) cb() }else{ timer = setTimeout(check,100) } } 阅读全文
摘要:
html = html.replace(/\{\{([^}]+)\}\}/g, function () { console.log(arguments[1]); })这是匹配{{name}}这种,arguments[1]是取到()里的值,这里是取到name 阅读全文
摘要:
console.log(1); async function async () { console.log(2); await console.log(3); console.log(4) } setTimeout(() => { console.log(5); }, 0); const promi 阅读全文
摘要:
<script> button.addEventListener('click',()=>{ console.log('listener1'); Promise.resolve().then(()=>console.log('micro task1')) }) button.addEventList 阅读全文
摘要:
<script> document.body.style.background = 'red'; console.log(1) Promise.resolve().then(()=>{ console.log(2) document.body.style.background = 'yellow'; 阅读全文
摘要:
http://zhufengpeixun.com/jg-vue/node/async-1.html#%E7%B1%BB%E5%9E%8B%E6%A3%80%E6%B5%8B 阅读全文
摘要:
// tj async+await = generator +co function co(it){ return new Promise((resolve,reject)=>{ // 异步迭代 需要next函数 function next(r){ let {value,done} = it.nex 阅读全文
摘要:
//generator 生成器 =》遍历器(需要有一个next方法)=》数组=》类数组 //...原理就是遍历这个对象,将结果放到数组中,这个数据必须得有个遍历器。[...new Set()] for of //[...likeArray] /Array.from(likeArray) const 阅读全文