摘要:
1 全局模式捕获:String.prototype.matchAll() const str = ` <html> <body> <div>这是第一个div</div> <p>这是p</p> <div>这是第二个div</div> <span>这是span</span> </body> </html
阅读全文
posted @ 2022-05-18 17:46
pleaseAnswer
阅读(27)
推荐(0)
编辑
摘要:
1 对象扩展 Object.fromEntries() 把键值对列表转换为一个对象 1.1 Object 转换 const obj = { name: 'imooc', course: 'es' } const entries = Object.entries(obj) console.log(en
阅读全文
posted @ 2022-05-18 17:41
pleaseAnswer
阅读(24)
推荐(0)
编辑
摘要:
1 异步迭代:for await of 1.1 同步迭代(模拟) const arr = ['es6', 'es7', 'es8', 'es9'] // 只适用于同步操作 arr[Symbol.iterator] = function() { let nextIndex = 0 return { n
阅读全文
posted @ 2022-05-18 17:37
pleaseAnswer
阅读(58)
推荐(0)
编辑
摘要:
1 异步编程解决方案 Async Await async 让我们写起 Promise 像同步操作 async/await 是函数定义的关键字 await 用于等待 promise 对象的返回结果,且不能单独使用必须放在 async 函数中 利用 async 定义的函数会返回一个 promise 对象
阅读全文
posted @ 2022-05-18 17:30
pleaseAnswer
阅读(31)
推荐(0)
编辑
摘要:
1 数组扩展:Array.prototype.includes(searchElement, fromIndex) fromIndex 从指定索引位置开始查找 1.1 返回值:Boolean const arr = ['es6', 'es7', 'es8'] console.log(arr.incl
阅读全文
posted @ 2022-05-18 17:27
pleaseAnswer
阅读(34)
推荐(0)
编辑
摘要:
1 异步操作必备知识 1.1 异步操作前置知识 1. js 是单线程的 2. 同步任务与异步任务 3. ajax 原理 前后端数据分离 前端 ↔ 后端 ajax 4. callback hell 回调地狱 2 Ajax 原理与 Callback Hell 2.1 ajax 原理 一种前后端的交互方式
阅读全文
posted @ 2022-05-18 17:17
pleaseAnswer
阅读(31)
推荐(0)
编辑